075d8f8a967f6e51cd4f1be858e07352fc41bdfc.svn-base 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.MeetMeetingInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.MeetMeetingInfo" id="meetMeetingInfoResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="title" column="TITLE"/>
  7. <result property="content" column="CONTENT"/>
  8. <result property="address" column="ADDRESS"/>
  9. <result property="stTm" column="ST_TM"/>
  10. <result property="enTm" column="EN_TM"/>
  11. <result property="startTm" column="START_TM"/>
  12. <result property="endTm" column="END_TM"/>
  13. <result property="gdX" column="GD_X"/>
  14. <result property="gdY" column="GD_Y"/>
  15. <result property="state" column="STATE"/>
  16. <result property="isOut" column="IS_OUT"/>
  17. <result property="isHasQues" column="IS_HAS_QUES"/>
  18. <result property="intm" column="INTM"/>
  19. </resultMap>
  20. <sql id="table_columns">
  21. ID,
  22. TITLE,
  23. CONTENT,
  24. ADDRESS,
  25. ST_TM,
  26. EN_TM,
  27. START_TM,
  28. END_TM,
  29. GD_X,
  30. GD_Y,
  31. STATE,
  32. IS_OUT,
  33. IS_HAS_QUES,
  34. INTM
  35. </sql>
  36. <sql id="entity_properties">
  37. #{id},
  38. #{title},
  39. #{content},
  40. #{address},
  41. #{stTm},
  42. #{enTm},
  43. #{startTm},
  44. #{endTm},
  45. #{gdX},
  46. #{gdY},
  47. #{state},
  48. #{isOut},
  49. #{isHasQues},
  50. #{intm}
  51. </sql>
  52. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  53. <sql id="page_where">
  54. <trim prefix="where" prefixOverrides="and | or ">
  55. <if test="title != null and title != ''">and TITLE like concat('%',#columnName#,'%')</if>
  56. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  57. <if test="address != null and address != ''">and ADDRESS = #{address}</if>
  58. <if test="stTm != null">and ST_TM = #{stTm}</if>
  59. <if test="enTm != null">and EN_TM = #{enTm}</if>
  60. <if test="startTm != null">and START_TM = #{startTm}</if>
  61. <if test="endTm != null">and END_TM = #{endTm}</if>
  62. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  63. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  64. <if test="state != null and state != ''">and STATE = #{state}</if>
  65. <if test="isOut != null and isOut != ''">and IS_OUT = #{isOut}</if>
  66. <if test="isHasQues != null and isHasQues != ''">and IS_HAS_QUES = #{isHasQues}</if>
  67. <if test="intm != null">and INTM = #{intm}</if>
  68. </trim>
  69. </sql>
  70. <select id="get" resultMap="meetMeetingInfoResultMap" parameterType="String">
  71. select
  72. <include refid="table_columns"/>
  73. from MEET_MEETING_INFO where ID = #{id}
  74. </select>
  75. <select id="getBy" resultMap="meetMeetingInfoResultMap">
  76. select
  77. <include refid="table_columns"/>
  78. from MEET_MEETING_INFO
  79. <include refid="page_where"/>
  80. </select>
  81. <select id="findAll" resultMap="meetMeetingInfoResultMap">
  82. select
  83. <include refid="table_columns"/>
  84. from MEET_MEETING_INFO
  85. </select>
  86. <select id="findList" resultMap="meetMeetingInfoResultMap">
  87. select
  88. <include refid="table_columns"/>
  89. from MEET_MEETING_INFO
  90. <include refid="page_where"/>
  91. </select>
  92. <select id="selectCount" resultType="int">
  93. select count(ID) from MEET_MEETING_INFO
  94. <include refid="page_where"/>
  95. </select>
  96. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.MeetMeetingInfo">
  97. insert into MEET_MEETING_INFO(
  98. <include refid="table_columns"/>
  99. )
  100. values (
  101. <include refid="entity_properties"/>
  102. )
  103. </insert>
  104. <delete id="delete" parameterType="java.lang.String">
  105. delete from MEET_MEETING_INFO where ID = #{id}
  106. </delete>
  107. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.MeetMeetingInfo">
  108. delete from MEET_MEETING_INFO
  109. <include refid="page_where"/>
  110. </delete>
  111. <update id="deleteInFlag" parameterType="java.lang.String">
  112. update MEET_MEETING_INFO set flag_valid = 0 where ID = #{id}
  113. </update>
  114. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.MeetMeetingInfo">
  115. update MEET_MEETING_INFO
  116. <trim prefix="set" suffixOverrides=",">
  117. <if test="title != null and title != ''">TITLE = #{title},</if>
  118. <if test="content != null and content != ''">CONTENT = #{content},</if>
  119. <if test="address != null and address != ''">ADDRESS = #{address},</if>
  120. <if test="stTm != null">ST_TM = #{stTm},</if>
  121. <if test="enTm != null">EN_TM = #{enTm},</if>
  122. <if test="startTm != null">START_TM = #{startTm},</if>
  123. <if test="endTm != null">END_TM = #{endTm},</if>
  124. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  125. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  126. <if test="state != null and state != ''">STATE = #{state},</if>
  127. <if test="isOut != null and isOut != ''">IS_OUT = #{isOut},</if>
  128. <if test="isHasQues != null and isHasQues != ''">IS_HAS_QUES = #{isHasQues},</if>
  129. <if test="intm != null">INTM = #{intm},</if>
  130. </trim>
  131. <where>ID = #{id}</where>
  132. </update>
  133. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.MeetMeetingInfo">
  134. update MEET_MEETING_INFO
  135. <trim prefix="set" suffixOverrides=",">
  136. <if test="title != null and title != ''">TITLE = #{title},</if>
  137. <if test="content != null and content != ''">CONTENT = #{content},</if>
  138. <if test="address != null and address != ''">ADDRESS = #{address},</if>
  139. <if test="stTm != null">ST_TM = #{stTm},</if>
  140. <if test="enTm != null">EN_TM = #{enTm},</if>
  141. <if test="startTm != null">START_TM = #{startTm},</if>
  142. <if test="endTm != null">END_TM = #{endTm},</if>
  143. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  144. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  145. <if test="state != null and state != ''">STATE = #{state},</if>
  146. <if test="isOut != null and isOut != ''">IS_OUT = #{isOut},</if>
  147. <if test="isHasQues != null and isHasQues != ''">IS_HAS_QUES = #{isHasQues},</if>
  148. <if test="intm != null">INTM = #{intm},</if>
  149. </trim>
  150. <include refid="page_where"/>
  151. </update>
  152. <select id="getMeetList" resultMap="meetMeetingInfoResultMap" parameterType="java.util.Map">
  153. SELECT A.* FROM MEET_MEETING_INFO A
  154. LEFT JOIN MEET_PERS_LIST B ON A.ID = B.MEETING_ID
  155. WHERE B.NAME = #{persName} AND B.MBLE_NUM = #{phone}
  156. AND DATE_ADD(STR_TO_DATE(A.START_TM,'%Y-%m-%d'), INTERVAL -1 DAY) &lt;= SYSDATE() AND SYSDATE() &lt;= DATE_ADD(STR_TO_DATE(A.END_TM,'%Y-%m-%d'), INTERVAL 1 DAY)
  157. </select>
  158. <!-- 其他自定义SQL -->
  159. <select id="getMeetPersList" resultType="cn.com.goldenwater.dcproj.model.MeetPersList"
  160. parameterType="java.util.Map">
  161. SELECT A.TITLE as meetName,B.* FROM MEET_MEETING_INFO A
  162. LEFT JOIN MEET_PERS_LIST B ON A.ID = B.MEETING_ID
  163. WHERE B.MBLE_NUM = #{phone}
  164. AND DATE_ADD(STR_TO_DATE(A.START_TM,'%Y-%m-%d'), INTERVAL -1 DAY) &lt;= SYSDATE() AND SYSDATE() &lt;= DATE_ADD(STR_TO_DATE(A.END_TM,'%Y-%m-%d'), INTERVAL 1 DAY)
  165. </select>
  166. </mapper>