TacPawpListDao.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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.TacPawpListDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacPawpList" id="tacPawpListResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="rgstrId" column="RGSTR_ID"/>
  7. <result property="type" column="TYPE"/>
  8. <result property="itmeDesc" column="ITME_DESC"/>
  9. <result property="itmeEval" column="ITME_EVAL"/>
  10. <result property="katalog" column="KATALOG"/>
  11. <result property="spcltYm" column="SPCLT_YM"/>
  12. <result property="revOpin" column="REV_OPIN"/>
  13. <result property="revTm" column="REV_TM"/>
  14. <result property="note" column="NOTE"/>
  15. <result property="persId" column="PERS_ID"/>
  16. <result property="groupId" column="GROUP_ID"/>
  17. <result property="intm" column="INTM"/>
  18. <result property="uptm" column="UPTM"/>
  19. <result property="dataStat" column="DATA_STAT"/>
  20. </resultMap>
  21. <sql id="table_columns">
  22. ID,
  23. RGSTR_ID,
  24. TYPE,
  25. ITME_DESC,
  26. ITME_EVAL,
  27. KATALOG,
  28. SPCLT_YM,
  29. REV_OPIN,
  30. REV_TM,
  31. NOTE,
  32. PERS_ID,
  33. GROUP_ID,
  34. INTM,
  35. UPTM,
  36. DATA_STAT
  37. </sql>
  38. <sql id="entity_properties">
  39. #{id},
  40. #{rgstrId},
  41. #{type},
  42. #{itmeDesc},
  43. #{itmeEval},
  44. #{katalog},
  45. #{spcltYm},
  46. #{revOpin},
  47. #{revTm},
  48. #{note},
  49. #{persId},
  50. #{groupId},
  51. #{intm},
  52. #{uptm},
  53. #{dataStat}
  54. </sql>
  55. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  56. <sql id="page_where">
  57. <trim prefix="where" prefixOverrides="and | or ">
  58. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  59. <if test="type != null and type != ''">and TYPE = #{type}</if>
  60. <if test="itmeDesc != null and itmeDesc != ''">and ITME_DESC like '%${itmeDesc}%'</if>
  61. <if test="itmeEval != null and itmeEval != ''">and ITME_EVAL like '%${itmeEval}%'</if>
  62. <if test="katalog != null and katalog != ''">and KATALOG = #{katalog}</if>
  63. <if test="spcltYm != null">and SPCLT_YM = #{spcltYm}</if>
  64. <if test="revOpin != null and revOpin != ''">and REV_OPIN like '%${revOpin}%'</if>
  65. <if test="revTm != null">and REV_TM = #{revTm}</if>
  66. <if test="note != null and note != ''">and NOTE like '%${note}%'</if>
  67. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  68. <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
  69. <if test="intm != null">and INTM = #{intm}</if>
  70. <if test="uptm != null">and UPTM = #{uptm}</if>
  71. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  72. </trim>
  73. </sql>
  74. <select id="get" resultMap="tacPawpListResultMap" parameterType="String">
  75. select
  76. <include refid="table_columns"/>
  77. from TAC_PAWP_LIST where ID = #{id}
  78. </select>
  79. <select id="getBy" resultMap="tacPawpListResultMap">
  80. select
  81. <include refid="table_columns"/>
  82. from TAC_PAWP_LIST
  83. <include refid="page_where"/>
  84. </select>
  85. <select id="findAll" resultMap="tacPawpListResultMap">
  86. select
  87. <include refid="table_columns"/>
  88. from TAC_PAWP_LIST
  89. </select>
  90. <select id="findPawpList" resultMap="tacPawpListResultMap">
  91. select
  92. <include refid="table_columns"/>
  93. from TAC_PAWP_LIST t where 1=1
  94. <if test="rgstrId != null and rgstrId != ''">and t.RGSTR_ID = #{rgstrId}</if>
  95. <if test="type != null and type != ''">and t.TYPE = #{type}</if>
  96. </select>
  97. <select id="findList" resultMap="tacPawpListResultMap">
  98. select p.* from (
  99. select t.*,r.obj_id from tac_pawp_rgstr r ,tac_pawp_list t where r.id=t.rgstr_id
  100. <if test="rgstrId != null and rgstrId != ''">and t.RGSTR_ID = #{rgstrId}</if>
  101. <if test="type != null and type != ''">and t.TYPE = #{type}</if>
  102. <if test="itmeDesc != null and itmeDesc != ''">and t.ITME_DESC like '%${itmeDesc}%'</if>
  103. <if test="itmeEval != null and itmeEval != ''">and t.ITME_EVAL like '%${itmeEval}%'</if>
  104. <if test="katalog != null and katalog != ''">and t.KATALOG = #{katalog}</if>
  105. <if test="spcltYm != null">and t.SPCLT_YM = #{spcltYm}</if>
  106. <if test="revOpin != null and revOpin != ''">and t.REV_OPIN like '%${revOpin}%'</if>
  107. <if test="revTm != null">and t.REV_TM = #{revTm}</if>
  108. <if test="note != null and note != ''">and t.NOTE like '%${note}%'</if>
  109. <if test="groupId != null and groupId != ''">and t.GROUP_ID = #{groupId}</if>
  110. <if test="intm != null">and t.INTM = #{intm}</if>
  111. <if test="uptm != null">and t.UPTM = #{uptm}</if>
  112. <if test="dataStat != null and dataStat != ''">and t.DATA_STAT = #{dataStat}</if>
  113. ) p
  114. </select>
  115. <select id="selectCount" resultType="int">
  116. select count(ID) from TAC_PAWP_LIST
  117. <include refid="page_where"/>
  118. </select>
  119. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPawpList">
  120. insert into TAC_PAWP_LIST(
  121. <include refid="table_columns"/>
  122. )
  123. values (
  124. <include refid="entity_properties"/>
  125. )
  126. </insert>
  127. <delete id="delete" parameterType="java.lang.String">
  128. delete from TAC_PAWP_LIST where ID = #{id}
  129. </delete>
  130. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpList">
  131. delete from TAC_PAWP_LIST
  132. <include refid="page_where"/>
  133. </delete>
  134. <update id="deleteInFlag" parameterType="java.lang.String">
  135. update TAC_PAWP_LIST set flag_valid = 0 where ID = #{id}
  136. </update>
  137. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPawpList">
  138. update TAC_PAWP_LIST
  139. <trim prefix="set" suffixOverrides=",">
  140. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  141. <if test="type != null and type != ''">TYPE = #{type},</if>
  142. <if test="itmeDesc != null">ITME_DESC = #{itmeDesc},</if>
  143. <if test="itmeEval != null">ITME_EVAL = #{itmeEval},</if>
  144. <if test="katalog != null">KATALOG = #{katalog},</if>
  145. <if test="spcltYm != null">SPCLT_YM = #{spcltYm},</if>
  146. <if test="revOpin != null">REV_OPIN = #{revOpin},</if>
  147. <if test="revTm != null">REV_TM = #{revTm},</if>
  148. <if test="note != null">NOTE = #{note},</if>
  149. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  150. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  151. <if test="intm != null">INTM = #{intm},</if>
  152. <if test="uptm != null">UPTM = #{uptm},</if>
  153. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  154. </trim>
  155. <where>ID = #{id}</where>
  156. </update>
  157. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpList">
  158. update TAC_PAWP_LIST
  159. <trim prefix="set" suffixOverrides=",">
  160. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  161. <if test="type != null and type != ''">TYPE = #{type},</if>
  162. <if test="itmeDesc != null">ITME_DESC = #{itmeDesc},</if>
  163. <if test="itmeEval != null">ITME_EVAL = #{itmeEval},</if>
  164. <if test="katalog != null">KATALOG = #{katalog},</if>
  165. <if test="spcltYm != null">SPCLT_YM = #{spcltYm},</if>
  166. <if test="revOpin != null">REV_OPIN = #{revOpin},</if>
  167. <if test="revTm != null">REV_TM = #{revTm},</if>
  168. <if test="note != null">NOTE = #{note},</if>
  169. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  170. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  171. <if test="intm != null">INTM = #{intm},</if>
  172. <if test="uptm != null">UPTM = #{uptm},</if>
  173. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  174. </trim>
  175. <include refid="page_where"/>
  176. </update>
  177. <!-- 其他自定义SQL -->
  178. </mapper>