TacPblmRectOrgDao.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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.TacPblmRectOrgDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacPblmRectOrg" id="tacPblmRectOrgResultMap">
  5. <result property="fileId" column="FILE_ID"/>
  6. <result property="fileName" column="FILE_NAME"/>
  7. <result property="filePath" column="FILE_PATH"/>
  8. <result property="rectFileId" column="RECT_FILE_ID"/>
  9. <result property="rectFileName" column="RECT_FILE_NAME"/>
  10. <result property="rectFilePath" column="RECT_FILE_PATH"/>
  11. <result property="title" column="TITLE"/>
  12. <result property="nub" column="NUB"/>
  13. <result property="explain" column="EXPLAIN"/>
  14. <result property="printTm" column="PRINT_TM"/>
  15. <result property="closeTm" column="CLOSE_TM"/>
  16. <result property="sndFileId" column="SND_FILE_ID"/>
  17. <result property="sndFileName" column="SND_FILE_NAME"/>
  18. <result property="sndFilePath" column="SND_FILE_PATH"/>
  19. <result property="id" column="ID"/>
  20. <result property="rectId" column="RECT_ID"/>
  21. <result property="year" column="YEAR"/>
  22. <result property="batch" column="BATCH"/>
  23. <result property="rectOrgId" column="RECT_ORG_ID"/>
  24. <result property="rectOrgNm" column="RECT_ORG_NM"/>
  25. <result property="prjctSize" column="PRJCT_SIZE"/>
  26. <result property="pblmSize" column="PBLM_SIZE"/>
  27. <result property="state" column="STATE"/>
  28. <result property="rectTm" column="RECT_TM"/>
  29. <result property="rectNub" column="RECT_NUB"/>
  30. <result property="chkState" column="CHK_STATE"/>
  31. <result property="chkPersInfo" column="CHK_PERS_INFO"/>
  32. <result property="placeDuty" column="PLACE_DUTY"/>
  33. <result property="rectPersId" column="RECT_PERS_ID"/>
  34. <result property="rectPersName" column="RECT_PERS_NAME"/>
  35. <result property="dutyTrace" column="DUTY_TRACE"/>
  36. <result property="persId" column="PERS_ID"/>
  37. <result property="persName" column="PERS_NAME"/>
  38. <result property="intm" column="INTM"/>
  39. <result property="uptm" column="UPTM"/>
  40. <result property="dataStat" column="DATA_STAT"/>
  41. </resultMap>
  42. <sql id="table_columns">
  43. FILE_ID,
  44. FILE_NAME,
  45. FILE_PATH,
  46. RECT_FILE_ID,
  47. RECT_FILE_NAME,
  48. RECT_FILE_PATH,
  49. TITLE,
  50. NUB,
  51. EXPLAIN,
  52. PRINT_TM,
  53. CLOSE_TM,
  54. ID,
  55. RECT_ID,
  56. YEAR,
  57. BATCH,
  58. RECT_ORG_ID,
  59. RECT_ORG_NM,
  60. PRJCT_SIZE,
  61. PBLM_SIZE,
  62. STATE,
  63. RECT_TM,
  64. RECT_NUB,
  65. CHK_STATE,
  66. CHK_PERS_INFO,
  67. PLACE_DUTY,
  68. RECT_PERS_ID,
  69. RECT_PERS_NAME,
  70. DUTY_TRACE,
  71. PERS_ID,
  72. PERS_NAME,
  73. INTM,
  74. UPTM,
  75. DATA_STAT
  76. </sql>
  77. <sql id="entity_properties">
  78. #{fileId},
  79. #{fileName},
  80. #{filePath},
  81. #{rectFileId},
  82. #{rectFileName},
  83. #{rectFilePath},
  84. #{title},
  85. #{nub},
  86. #{explain},
  87. #{printTm},
  88. #{closeTm},
  89. #{id},
  90. #{rectId},
  91. #{year},
  92. #{batch},
  93. #{rectOrgId},
  94. #{rectOrgNm},
  95. #{prjctSize},
  96. #{pblmSize},
  97. #{state},
  98. #{rectTm},
  99. #{rectNub},
  100. #{chkState},
  101. #{chkPersInfo},
  102. #{placeDuty},
  103. #{rectPersId},
  104. #{rectPersName},
  105. #{dutyTrace},
  106. #{persId},
  107. #{persName},
  108. #{intm},
  109. #{uptm},
  110. #{dataStat}
  111. </sql>
  112. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  113. <sql id="page_where">
  114. <trim prefix="where" prefixOverrides="and | or ">
  115. <if test="fileName != null and fileName != ''">and A.FILE_NAME = #{fileName}</if>
  116. <if test="filePath != null and filePath != ''">and A.FILE_PATH = #{filePath}</if>
  117. <if test="rectFileId != null and rectFileId != ''">and RECT_FILE_ID = #{rectFileId}</if>
  118. <if test="rectFileName != null and rectFileName != ''">and RECT_FILE_NAME = #{rectFileName}</if>
  119. <if test="rectFilePath != null and rectFilePath != ''">and RECT_FILE_PATH = #{rectFilePath}</if>
  120. <if test="title != null and title != ''">and TITLE = #{title}</if>
  121. <if test="nub != null and nub != ''">and NUB = #{nub}</if>
  122. <if test="explain != null and explain != ''">and EXPLAIN = #{explain}</if>
  123. <if test="printTm != null">and PRINT_TM = #{printTm}</if>
  124. <if test="closeTm != null">and CLOSE_TM = #{closeTm}</if>
  125. <if test="sndFileId != null and sndFileId != ''">and SND_FILE_ID = #{sndFileId}</if>
  126. <if test="sndFileName != null and sndFileName != ''">and SND_FILE_NAME = #{sndFileName}</if>
  127. <if test="sndFilePath != null and sndFilePath != ''">and SND_FILE_PATH = #{sndFilePath}</if>
  128. <if test="id != null and id != ''">and ID = #{id}</if>
  129. <if test="rectId != null and rectId != ''">and RECT_ID = #{rectId}</if>
  130. <if test="year != null and year != ''">and YEAR = #{year}</if>
  131. <if test="batch != null and batch != ''">and BATCH = #{batch}</if>
  132. <if test="rectOrgId != null and rectOrgId != ''">and RECT_ORG_ID = #{rectOrgId}</if>
  133. <if test="rectOrgNm != null and rectOrgNm != ''">and RECT_ORG_NM = #{rectOrgNm}</if>
  134. <if test="prjctSize != null and prjctSize != ''">and PRJCT_SIZE = #{prjctSize}</if>
  135. <if test="pblmSize != null and pblmSize != ''">and PBLM_SIZE = #{pblmSize}</if>
  136. <if test="state != null and state != ''">and STATE in (${state})</if>
  137. <if test="rectTm != null">and RECT_TM = #{rectTm}</if>
  138. <if test="rectNub != null and rectNub != ''">and RECT_NUB = #{rectNub}</if>
  139. <if test="chkState != null and chkState != ''">and CHK_STATE = #{chkState}</if>
  140. <if test="chkPersInfo != null and chkPersInfo != ''">and CHK_PERS_INFO = #{chkPersInfo}</if>
  141. <if test="placeDuty != null and placeDuty != ''">and PLACE_DUTY = #{placeDuty}</if>
  142. <if test="rectPersId != null and rectPersId != ''">and RECT_PERS_ID = #{rectPersId}</if>
  143. <if test="rectPersName != null and rectPersName != ''">and RECT_PERS_NAME = #{rectPersName}</if>
  144. <if test="dutyTrace != null and dutyTrace != ''">and DUTY_TRACE = #{dutyTrace}</if>
  145. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  146. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  147. <if test="intm != null">and INTM = #{intm}</if>
  148. <if test="uptm != null">and UPTM = #{uptm}</if>
  149. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  150. and DATA_STAT='0'
  151. </trim>
  152. </sql>
  153. <select id="get" resultMap="tacPblmRectOrgResultMap" parameterType="String">
  154. select FILE_ID, A.FILE_NAME, A.FILE_PATH,
  155. RECT_FILE_ID, RECT_FILE_NAME, RECT_FILE_PATH, TITLE, NUB,
  156. EXPLAIN, PRINT_TM, CLOSE_TM, A.ID, RECT_ID, YEAR, BATCH,
  157. RECT_ORG_ID, RECT_ORG_NM, PRJCT_SIZE, PBLM_SIZE, STATE,
  158. RECT_TM, RECT_NUB, CHK_STATE, CHK_PERS_INFO, PLACE_DUTY,
  159. RECT_PERS_ID, RECT_PERS_NAME,
  160. DUTY_TRACE, PERS_ID, PERS_NAME, INTM, UPTM, DATA_STAT,(case when FILE_ID IS NOT NULL THEN '1' ELSE '0' END )file_State,
  161. B.FILE_NAME SND_FILE_NAME,B.ID SND_FILE_ID,B.FILE_PATH SND_FILE_PATH
  162. from
  163. TAC_PBLM_RECT_ORG A LEFT JOIN GW_COM_FILE B ON A.RECT_ID=B.BIZ_ID where A.ID = #{id}
  164. </select>
  165. <select id="getBy" resultMap="tacPblmRectOrgResultMap">
  166. select
  167. <include refid="table_columns"/>
  168. from TAC_PBLM_RECT_ORG
  169. <include refid="page_where"/>
  170. </select>
  171. <select id="findAll" resultMap="tacPblmRectOrgResultMap">
  172. select
  173. <include refid="table_columns"/>
  174. from TAC_PBLM_RECT_ORG
  175. </select>
  176. <select id="findList" resultMap="tacPblmRectOrgResultMap">
  177. select FILE_ID, A.FILE_NAME, A.FILE_PATH,
  178. RECT_FILE_ID, RECT_FILE_NAME, RECT_FILE_PATH, TITLE, NUB,
  179. EXPLAIN, PRINT_TM, CLOSE_TM, A.ID, RECT_ID, YEAR, BATCH,
  180. RECT_ORG_ID, RECT_ORG_NM, PRJCT_SIZE, PBLM_SIZE, STATE,
  181. RECT_TM, RECT_NUB, CHK_STATE, CHK_PERS_INFO, PLACE_DUTY,
  182. RECT_PERS_ID, RECT_PERS_NAME,
  183. DUTY_TRACE, PERS_ID, PERS_NAME, INTM, UPTM, DATA_STAT,(case when FILE_ID IS NOT NULL THEN '1' ELSE '0' END
  184. )file_State,
  185. B.FILE_NAME SND_FILE_NAME,B.ID SND_FILE_ID,B.FILE_PATH SND_FILE_PATH
  186. from
  187. TAC_PBLM_RECT_ORG A LEFT JOIN GW_COM_FILE B ON A.RECT_ID=B.BIZ_ID
  188. <include refid="page_where"/>
  189. ORDER BY YEAR,BATCH
  190. </select>
  191. <select id="selectCount" resultType="int">
  192. select count(ID) from TAC_PBLM_RECT_ORG
  193. <include refid="page_where"/>
  194. </select>
  195. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectOrg">
  196. insert into TAC_PBLM_RECT_ORG(
  197. <include refid="table_columns"/>
  198. )
  199. values (
  200. <include refid="entity_properties"/>
  201. )
  202. </insert>
  203. <delete id="delete" parameterType="java.lang.String">
  204. update TAC_PBLM_RECT_ORG set DATA_STAT='9' where ID = #{id}
  205. </delete>
  206. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectOrg">
  207. update TAC_PBLM_RECT_ORG set DATA_STAT='9'
  208. <include refid="page_where"/>
  209. </delete>
  210. <update id="deleteInFlag" parameterType="java.lang.String">
  211. update TAC_PBLM_RECT_ORG set flag_valid = 0 where ID = #{id}
  212. </update>
  213. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectOrg">
  214. update TAC_PBLM_RECT_ORG
  215. <trim prefix="set" suffixOverrides=",">
  216. <if test="fileId != null and fileId != ''">FILE_ID = #{fileId},</if>
  217. <if test="fileName != null and fileName != ''">FILE_NAME = #{fileName},</if>
  218. <if test="filePath != null and filePath != ''">FILE_PATH = #{filePath},</if>
  219. <if test="rectFileId != null and rectFileId != ''">RECT_FILE_ID = #{rectFileId},</if>
  220. <if test="rectFileName != null and rectFileName != ''">RECT_FILE_NAME = #{rectFileName},</if>
  221. <if test="rectFilePath != null and rectFilePath != ''">RECT_FILE_PATH = #{rectFilePath},</if>
  222. <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
  223. <if test="year != null and year != ''">YEAR = #{year},</if>
  224. <if test="batch != null and batch != ''">BATCH = #{batch},</if>
  225. <if test="sndFileId != null and sndFileId != ''">SND_FILE_ID = #{sndFileId},</if>
  226. <if test="rectOrgId != null and rectOrgId != ''">RECT_ORG_ID = #{rectOrgId},</if>
  227. <if test="rectOrgNm != null and rectOrgNm != ''">RECT_ORG_NM = #{rectOrgNm},</if>
  228. <if test="prjctSize != null and prjctSize != ''">PRJCT_SIZE = #{prjctSize},</if>
  229. <if test="pblmSize != null and pblmSize != ''">PBLM_SIZE = #{pblmSize},</if>
  230. <if test="state != null and state != ''">STATE = #{state},</if>
  231. <if test="rectTm != null">RECT_TM = #{rectTm},</if>
  232. <if test="rectNub != null and rectNub != ''">RECT_NUB = #{rectNub},</if>
  233. <if test="chkState != null and chkState != ''">CHK_STATE = #{chkState},</if>
  234. <if test="chkPersInfo != null and chkPersInfo != ''">CHK_PERS_INFO = #{chkPersInfo},</if>
  235. <if test="placeDuty != null and placeDuty != ''">PLACE_DUTY = #{placeDuty},</if>
  236. <if test="rectPersId != null and rectPersId != ''">RECT_PERS_ID = #{rectPersId},</if>
  237. <if test="rectPersName != null and rectPersName != ''">RECT_PERS_NAME = #{rectPersName},</if>
  238. <if test="dutyTrace != null and dutyTrace != ''">DUTY_TRACE = #{dutyTrace},</if>
  239. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  240. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  241. <if test="intm != null">INTM = #{intm},</if>
  242. <if test="uptm != null">UPTM = #{uptm},</if>
  243. <if test="title != null and title != ''">TITLE = #{title},</if>
  244. <if test="nub != null and nub != ''">NUB = #{nub},</if>
  245. <if test="explain != null and explain != ''">EXPLAIN = #{explain},</if>
  246. <if test="printTm != null">PRINT_TM = #{printTm},</if>
  247. <if test="closeTm != null">CLOSE_TM = #{closeTm},</if>
  248. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  249. </trim>
  250. <where>ID = #{id}</where>
  251. </update>
  252. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectOrg">
  253. update TAC_PBLM_RECT_ORG
  254. <trim prefix="set" suffixOverrides=",">
  255. <if test="title != null and title != ''">TITLE = #{title},</if>
  256. <if test="nub != null and nub != ''">NUB = #{nub},</if>
  257. <if test="explain != null and explain != ''">EXPLAIN = #{explain},</if>
  258. <if test="printTm != null">PRINT_TM = #{printTm},</if>
  259. <if test="closeTm != null">CLOSE_TM = #{closeTm},</if>
  260. </trim>
  261. <where>RECT_ID = #{rectId}</where>
  262. </update>
  263. <!-- 其他自定义SQL -->
  264. <update id="setFileNull" parameterType="java.lang.String">
  265. update TAC_PBLM_RECT_ORG set file_id=null,file_path=null,file_name=null where ID = #{id}
  266. </update>
  267. <update id="setRectFileNull" parameterType="java.lang.String">
  268. update TAC_PBLM_RECT_ORG set rect_file_id=null,rect_file_path=null,rect_file_name=null where ID = #{id}
  269. </update>
  270. </mapper>