TacPblmRectPrctDao.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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.TacPblmRectPrctDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacPblmRectPrct" id="tacPblmRectPrctResultMap">
  5. <result property="year" column="YEAR"/>
  6. <result property="batch" column="BATCH"/>
  7. <result property="orgId" column="ORG_ID"/>
  8. <result property="orgNm" column="ORG_NM"/>
  9. <result property="id" column="ID"/>
  10. <result property="rectOrgId" column="RECT_ORG_ID"/>
  11. <result property="rgstrId" column="RGSTR_ID"/>
  12. <result property="name" column="NAME"/>
  13. <result property="feedBack" column="FEED_BACK"/>
  14. <result property="rectPersId" column="RECT_PERS_ID"/>
  15. <result property="rectPersName" column="RECT_PERS_NAME"/>
  16. <result property="persId" column="PERS_ID"/>
  17. <result property="persName" column="PERS_NAME"/>
  18. <result property="intm" column="INTM"/>
  19. <result property="uptm" column="UPTM"/>
  20. <result property="dataStat" column="DATA_STAT"/>
  21. <result property="rectId" column="RECT_ID"/>
  22. </resultMap>
  23. <sql id="table_columns">
  24. YEAR,
  25. BATCH,
  26. ORG_ID,
  27. ORG_NM,
  28. ID,
  29. RECT_ORG_ID,
  30. RGSTR_ID,
  31. NAME,
  32. FEED_BACK,
  33. RECT_PERS_ID,
  34. RECT_PERS_NAME,
  35. PERS_ID,
  36. PERS_NAME,
  37. INTM,
  38. UPTM,
  39. DATA_STAT,
  40. RECT_ID
  41. </sql>
  42. <sql id="entity_properties">
  43. #{year},
  44. #{batch},
  45. #{orgId},
  46. #{orgNm},
  47. #{id},
  48. #{rectOrgId},
  49. #{rgstrId},
  50. #{name},
  51. #{feedBack},
  52. #{rectPersId},
  53. #{rectPersName},
  54. #{persId},
  55. #{persName},
  56. #{intm},
  57. #{uptm},
  58. #{dataStat},
  59. #{rectId}
  60. </sql>
  61. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  62. <sql id="page_where">
  63. <trim prefix="where" prefixOverrides="and | or ">
  64. <if test="batch != null and batch != ''">and BATCH = #{batch}</if>
  65. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  66. <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
  67. <if test="id != null and id != ''">and ID = #{id}</if>
  68. <if test="rectOrgId != null and rectOrgId != ''">and RECT_ORG_ID = #{rectOrgId}</if>
  69. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  70. <if test="name != null and name != ''">and NAME = #{name}</if>
  71. <if test="feedBack != null and feedBack != ''">and FEED_BACK = #{feedBack}</if>
  72. <if test="rectPersId != null and rectPersId != ''">and RECT_PERS_ID = #{rectPersId}</if>
  73. <if test="rectPersName != null and rectPersName != ''">and RECT_PERS_NAME = #{rectPersName}</if>
  74. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  75. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  76. <if test="intm != null">and INTM = #{intm}</if>
  77. <if test="uptm != null">and UPTM = #{uptm}</if>
  78. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  79. <if test="rectId != null and rectId != ''">and RECT_ID = #{rectId}</if>
  80. and DATA_STAT='0'
  81. </trim>
  82. </sql>
  83. <select id="get" resultMap="tacPblmRectPrctResultMap" parameterType="String" >
  84. select <include refid="table_columns" /> from TAC_PBLM_RECT_PRCT where ID = #{id}
  85. </select>
  86. <select id="getBy" resultMap="tacPblmRectPrctResultMap">
  87. select <include refid="table_columns" /> from TAC_PBLM_RECT_PRCT <include refid="page_where" />
  88. </select>
  89. <select id="findAll" resultMap="tacPblmRectPrctResultMap">
  90. select <include refid="table_columns" /> from TAC_PBLM_RECT_PRCT
  91. </select>
  92. <select id="findList" resultMap="tacPblmRectPrctResultMap">
  93. select <include refid="table_columns" /> from TAC_PBLM_RECT_PRCT <include refid="page_where" /> ORDER BY YEAR,BATCH
  94. </select>
  95. <select id="selectCount" resultType="int" >
  96. select count(ID) from TAC_PBLM_RECT_PRCT <include refid="page_where" />
  97. </select>
  98. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectPrct">
  99. insert into TAC_PBLM_RECT_PRCT( <include refid="table_columns" /> )
  100. values ( <include refid="entity_properties" /> )
  101. </insert>
  102. <delete id="delete" parameterType="java.lang.String">
  103. update TAC_PBLM_RECT_PRCT set DATA_STAT='9' where ID = #{id}
  104. </delete>
  105. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectPrct">
  106. update TAC_PBLM_RECT_PRCT set DATA_STAT='9' <include refid="page_where" />
  107. </delete>
  108. <update id="deleteInFlag" parameterType="java.lang.String">
  109. update TAC_PBLM_RECT_PRCT set flag_valid = 0 where ID = #{id}
  110. </update>
  111. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectPrct">
  112. update TAC_PBLM_RECT_PRCT
  113. <trim prefix="set" suffixOverrides=",">
  114. <if test="batch != null and batch != ''">BATCH = #{batch},</if>
  115. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  116. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  117. <if test="id != null and id != ''">ID = #{id},</if>
  118. <if test="rectOrgId != null and rectOrgId != ''">RECT_ORG_ID = #{rectOrgId},</if>
  119. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  120. <if test="name != null and name != ''">NAME = #{name},</if>
  121. <if test="feedBack != null and feedBack != ''">FEED_BACK = #{feedBack},</if>
  122. <if test="rectPersId != null and rectPersId != ''">RECT_PERS_ID = #{rectPersId},</if>
  123. <if test="rectPersName != null and rectPersName != ''">RECT_PERS_NAME = #{rectPersName},</if>
  124. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  125. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  126. <if test="intm != null">INTM = #{intm},</if>
  127. <if test="uptm != null">UPTM = #{uptm},</if>
  128. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  129. <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
  130. </trim>
  131. <where>ID = #{id}</where>
  132. </update>
  133. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectPrct">
  134. update TAC_PBLM_RECT_PRCT
  135. <trim prefix="set" suffixOverrides=",">
  136. <if test="batch != null and batch != ''">BATCH = #{batch},</if>
  137. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  138. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  139. <if test="id != null and id != ''">ID = #{id},</if>
  140. <if test="rectOrgId != null and rectOrgId != ''">RECT_ORG_ID = #{rectOrgId},</if>
  141. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  142. <if test="name != null and name != ''">NAME = #{name},</if>
  143. <if test="feedBack != null and feedBack != ''">FEED_BACK = #{feedBack},</if>
  144. <if test="rectPersId != null and rectPersId != ''">RECT_PERS_ID = #{rectPersId},</if>
  145. <if test="rectPersName != null and rectPersName != ''">RECT_PERS_NAME = #{rectPersName},</if>
  146. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  147. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  148. <if test="intm != null">INTM = #{intm},</if>
  149. <if test="uptm != null">UPTM = #{uptm},</if>
  150. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  151. <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
  152. </trim>
  153. <include refid="page_where" />
  154. </update>
  155. <!-- 其他自定义SQL -->
  156. </mapper>