TacPblmRectPblmDao.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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.TacPblmRectPblmDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacPblmRectPblm" id="tacPblmRectPblmResultMap">
  5. <result property="rectId" column="RECT_ID"/>
  6. <result property="rectOrgId" column="RECT_ORG_ID"/>
  7. <result property="year" column="YEAR"/>
  8. <result property="batch" column="BATCH"/>
  9. <result property="note" column="NOTE"/>
  10. <result property="orgId" column="ORG_ID"/>
  11. <result property="orgNm" column="ORG_NM"/>
  12. <result property="id" column="ID"/>
  13. <result property="objId" column="OBJ_ID"/>
  14. <result property="rgstrId" column="RGSTR_ID"/>
  15. <result property="name" column="NAME"/>
  16. <result property="pblmId" column="PBLM_ID"/>
  17. <result property="pblmNm" column="PBLM_NM"/>
  18. <result property="pblmPasi" column="PBLM_PASI"/>
  19. <result property="ifCasePblm" column="IF_CASE_PBLM"/>
  20. <result property="pblmDesc" column="PBLM_DESC"/>
  21. <result property="pblmReason" column="PBLM_REASON"/>
  22. <result property="rectState" column="RECT_STATE"/>
  23. <result property="rectPersId" column="RECT_PERS_ID"/>
  24. <result property="rectPersName" column="RECT_PERS_NAME"/>
  25. <result property="rectExplain" column="RECT_EXPLAIN"/>
  26. <result property="rectDept" column="RECT_DEPT"/>
  27. <result property="rectBlame" column="RECT_BLAME"/>
  28. <result property="rectSps" column="RECT_SPS"/>
  29. <result property="rectCompTm" column="RECT_COMP_TM"/>
  30. <result property="state" column="STATE"/>
  31. <result property="persId" column="PERS_ID"/>
  32. <result property="persName" column="PERS_NAME"/>
  33. <result property="intm" column="INTM"/>
  34. <result property="uptm" column="UPTM"/>
  35. <result property="dataStat" column="DATA_STAT"/>
  36. <result property="listType" column="LIST_TYPE"/>
  37. <result property="pblmstdId" column="PBLMSTD_ID"/>
  38. </resultMap>
  39. <sql id="table_columns">
  40. RECT_ID,
  41. RECT_ORG_ID,
  42. YEAR,
  43. BATCH,
  44. NOTE,
  45. ORG_ID,
  46. ORG_NM,
  47. ID,
  48. OBJ_ID,
  49. RGSTR_ID,
  50. NAME,
  51. PBLM_ID,
  52. PBLM_NM,
  53. PBLM_PASI,
  54. IF_CASE_PBLM,
  55. PBLM_DESC,
  56. PBLM_REASON,
  57. RECT_STATE,
  58. RECT_PERS_ID,
  59. RECT_PERS_NAME,
  60. RECT_EXPLAIN,
  61. RECT_DEPT,
  62. RECT_BLAME,
  63. RECT_SPS,
  64. RECT_COMP_TM,
  65. STATE,
  66. PERS_ID,
  67. PERS_NAME,
  68. INTM,
  69. UPTM,
  70. DATA_STAT,
  71. LIST_TYPE,
  72. PBLMSTD_ID
  73. </sql>
  74. <sql id="entity_properties">
  75. #{rectId},
  76. #{rectOrgId},
  77. #{year},
  78. #{batch},
  79. #{note},
  80. #{orgId},
  81. #{orgNm},
  82. #{id},
  83. #{objId},
  84. #{rgstrId},
  85. #{name},
  86. #{pblmId},
  87. #{pblmNm},
  88. #{pblmPasi},
  89. #{ifCasePblm},
  90. #{pblmDesc},
  91. #{pblmReason},
  92. #{rectState},
  93. #{rectPersId},
  94. #{rectPersName},
  95. #{rectExplain},
  96. #{rectDept},
  97. #{rectBlame},
  98. #{rectSps},
  99. #{rectCompTm},
  100. #{state},
  101. #{persId},
  102. #{persName},
  103. #{intm},
  104. #{uptm},
  105. #{dataStat},
  106. #{listType},
  107. #{pblmstdId}
  108. </sql>
  109. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  110. <sql id="page_where">
  111. <trim prefix="where" prefixOverrides="and | or ">
  112. <if test="rectOrgId != null and rectOrgId != ''">and RECT_ORG_ID = #{rectOrgId}</if>
  113. <if test="year != null and year != ''">and YEAR = #{year}</if>
  114. <if test="batch != null and batch != ''">and BATCH = #{batch}</if>
  115. <if test="note != null and note != ''">and NOTE = #{note}</if>
  116. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  117. <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
  118. <if test="id != null and id != ''">and ID = #{id}</if>
  119. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  120. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  121. <if test="name != null and name != ''">and NAME like '${name}%'</if>
  122. <if test="pblmId != null and pblmId != ''">and PBLM_ID = #{pblmId}</if>
  123. <if test="pblmNm != null and pblmNm != ''">and PBLM_NM like '${pblmNm}%'</if>
  124. <if test="pblmPasi != null and pblmPasi != ''">and PBLM_PASI = #{pblmPasi}</if>
  125. <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
  126. <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
  127. <if test="pblmReason != null and pblmReason != ''">and PBLM_REASON = #{pblmReason}</if>
  128. <if test="rectState != null and rectState != ''">and RECT_STATE = #{rectState}</if>
  129. <if test="rectPersId != null and rectPersId != ''">and RECT_PERS_ID = #{rectPersId}</if>
  130. <if test="rectPersName != null and rectPersName != ''">and RECT_PERS_NAME = #{rectPersName}</if>
  131. <if test="rectExplain != null and rectExplain != ''">and RECT_EXPLAIN = #{rectExplain}</if>
  132. <if test="rectDept != null and rectDept != ''">and RECT_DEPT = #{rectDept}</if>
  133. <if test="rectBlame != null and rectBlame != ''">and RECT_BLAME = #{rectBlame}</if>
  134. <if test="rectSps != null and rectSps != ''">and RECT_SPS = #{rectSps}</if>
  135. <if test="rectCompTm != null">and RECT_COMP_TM = #{rectCompTm}</if>
  136. <if test="state != null and state != ''">and STATE in (${state})</if>
  137. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  138. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  139. <if test="intm != null">and INTM = #{intm}</if>
  140. <if test="uptm != null">and UPTM = #{uptm}</if>
  141. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  142. <if test="listType != null and listType != ''">and LIST_TYPE = #{listType}</if>
  143. <if test="pblmstdId != null and pblmstdId != ''">and PBLMSTD_ID = #{pblmstdId}</if>
  144. and DATA_STAT='0'
  145. </trim>
  146. </sql>
  147. <select id="get" resultMap="tacPblmRectPblmResultMap" parameterType="String">
  148. select
  149. <include refid="table_columns"/>
  150. from TAC_PBLM_RECT_PBLM where ID = #{id}
  151. </select>
  152. <select id="getBy" resultMap="tacPblmRectPblmResultMap">
  153. select
  154. <include refid="table_columns"/>
  155. from TAC_PBLM_RECT_PBLM
  156. <include refid="page_where"/>
  157. </select>
  158. <select id="findAll" resultMap="tacPblmRectPblmResultMap">
  159. select
  160. <include refid="table_columns"/>
  161. from TAC_PBLM_RECT_PBLM
  162. </select>
  163. <select id="findList" resultMap="tacPblmRectPblmResultMap">
  164. select
  165. <include refid="table_columns"/>
  166. from TAC_PBLM_RECT_PBLM
  167. <include refid="page_where"/>
  168. ORDER BY YEAR,BATCH,intm
  169. </select>
  170. <select id="selectCount" resultType="int">
  171. select count(ID) from TAC_PBLM_RECT_PBLM
  172. <include refid="page_where"/>
  173. </select>
  174. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectPblm">
  175. insert into TAC_PBLM_RECT_PBLM(
  176. <include refid="table_columns"/>
  177. )
  178. values (
  179. <include refid="entity_properties"/>
  180. )
  181. </insert>
  182. <delete id="delete" parameterType="java.lang.String">
  183. update TAC_PBLM_RECT_PBLM set DATA_STAT='9' where ID = #{id}
  184. </delete>
  185. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectPblm">
  186. update TAC_PBLM_RECT_PBLM set DATA_STAT='9'
  187. <include refid="page_where"/>
  188. </delete>
  189. <update id="deleteInFlag" parameterType="java.lang.String">
  190. update TAC_PBLM_RECT_PBLM set flag_valid = '9' where ID = #{id}
  191. </update>
  192. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectPblm">
  193. update TAC_PBLM_RECT_PBLM
  194. <trim prefix="set" suffixOverrides=",">
  195. <if test="pblmstdId != null and pblmstdId != ''">PBLMSTD_ID = #{pblmstdId},</if>
  196. <if test="rectOrgId != null and rectOrgId != ''">RECT_ORG_ID = #{rectOrgId},</if>
  197. <if test="year != null and year != ''">YEAR = #{year},</if>
  198. <if test="batch != null and batch != ''">BATCH = #{batch},</if>
  199. <if test="note != null and note != ''">NOTE = #{note},</if>
  200. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  201. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  202. <if test="id != null and id != ''">ID = #{id},</if>
  203. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  204. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  205. <if test="name != null and name != ''">NAME = #{name},</if>
  206. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  207. <if test="pblmNm != null and pblmNm != ''">PBLM_NM = #{pblmNm},</if>
  208. <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
  209. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  210. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  211. <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
  212. <if test="rectState != null and rectState != ''">RECT_STATE = #{rectState},</if>
  213. <if test="rectPersId != null and rectPersId != ''">RECT_PERS_ID = #{rectPersId},</if>
  214. <if test="rectPersName != null and rectPersName != ''">RECT_PERS_NAME = #{rectPersName},</if>
  215. <if test="rectExplain != null and rectExplain != ''">RECT_EXPLAIN = #{rectExplain},</if>
  216. <if test="rectDept != null and rectDept != ''">RECT_DEPT = #{rectDept},</if>
  217. <if test="rectBlame != null and rectBlame != ''">RECT_BLAME = #{rectBlame},</if>
  218. <if test="rectSps != null and rectSps != ''">RECT_SPS = #{rectSps},</if>
  219. <if test="rectCompTm != null">RECT_COMP_TM = #{rectCompTm},</if>
  220. <if test="state != null and state != ''">STATE = #{state},</if>
  221. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  222. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  223. <if test="intm != null">INTM = #{intm},</if>
  224. <if test="uptm != null">UPTM = #{uptm},</if>
  225. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  226. <if test="listType != null and listType != ''">LIST_TYPE = #{listType},</if>
  227. </trim>
  228. <where>ID = #{id}</where>
  229. </update>
  230. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectPblm">
  231. update TAC_PBLM_RECT_PBLM
  232. <trim prefix="set" suffixOverrides=",">
  233. <if test="pblmstdId != null and pblmstdId != ''">PBLMSTD_ID = #{pblmstdId},</if>
  234. <if test="rectOrgId != null and rectOrgId != ''">RECT_ORG_ID = #{rectOrgId},</if>
  235. <if test="year != null and year != ''">YEAR = #{year},</if>
  236. <if test="batch != null and batch != ''">BATCH = #{batch},</if>
  237. <if test="note != null and note != ''">NOTE = #{note},</if>
  238. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  239. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  240. <if test="id != null and id != ''">ID = #{id},</if>
  241. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  242. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  243. <if test="name != null and name != ''">NAME = #{name},</if>
  244. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  245. <if test="pblmNm != null and pblmNm != ''">PBLM_NM = #{pblmNm},</if>
  246. <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
  247. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  248. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  249. <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
  250. <if test="rectState != null and rectState != ''">RECT_STATE = #{rectState},</if>
  251. <if test="rectPersId != null and rectPersId != ''">RECT_PERS_ID = #{rectPersId},</if>
  252. <if test="rectPersName != null and rectPersName != ''">RECT_PERS_NAME = #{rectPersName},</if>
  253. <if test="rectExplain != null and rectExplain != ''">RECT_EXPLAIN = #{rectExplain},</if>
  254. <if test="rectDept != null and rectDept != ''">RECT_DEPT = #{rectDept},</if>
  255. <if test="rectBlame != null and rectBlame != ''">RECT_BLAME = #{rectBlame},</if>
  256. <if test="rectSps != null and rectSps != ''">RECT_SPS = #{rectSps},</if>
  257. <if test="rectCompTm != null">RECT_COMP_TM = #{rectCompTm},</if>
  258. <if test="state != null and state != ''">STATE = #{state},</if>
  259. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  260. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  261. <if test="intm != null">INTM = #{intm},</if>
  262. <if test="uptm != null">UPTM = #{uptm},</if>
  263. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  264. <if test="listType != null and listType != ''">LIST_TYPE = #{listType},</if>
  265. </trim>
  266. <include refid="page_where"/>
  267. </update>
  268. <!-- 其他自定义SQL -->
  269. </mapper>