BisInspMtprgDao.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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.BisInspMtprgDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspMtprg" id="bisInspMtprgResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="unitName" column="UNIT_NAME"/>
  7. <result property="year" column="YEAR"/>
  8. <result property="mnth" column="MNTH"/>
  9. <result property="month" column="MONTH"/>
  10. <result property="matter" column="MATTER"/>
  11. <result property="mainWork" column="MAIN_WORK"/>
  12. <result property="spcChkSize" column="SPC_CHK_SIZE"/>
  13. <result property="inspSize" column="INSP_SIZE"/>
  14. <result property="inspPersSize" column="INSP_PERS_SIZE"/>
  15. <result property="chkPrjSize" column="CHK_PRJ_SIZE"/>
  16. <result property="findPblmSize" column="FIND_PBLM_SIZE"/>
  17. <result property="accnUnitSize" column="ACCN_UNIT_SIZE"/>
  18. <result property="accnPersSize" column="ACCN_PERS_SIZE"/>
  19. <result property="pblmMendSize" column="PBLM_MEND_SIZE"/>
  20. <result property="pubRptSize" column="PUB_RPT_SIZE"/>
  21. <result property="chkSysNote" column="CHK_SYS_NOTE"/>
  22. <result property="leadChkSize" column="LEAD_CHK_SIZE"/>
  23. <result property="leadChkNote" column="LEAD_CHK_NOTE"/>
  24. <result property="persId" column="PERS_ID"/>
  25. <result property="intm" column="INTM"/>
  26. <result property="uptm" column="UPTM"/>
  27. <result property="dataStat" column="DATA_STAT"/>
  28. <result property="adCode" column="AD_CODE"/>
  29. </resultMap>
  30. <sql id="table_columns">
  31. ID,
  32. UNIT_NAME,
  33. YEAR,
  34. MNTH,
  35. MONTH,
  36. MATTER,
  37. MAIN_WORK,
  38. SPC_CHK_SIZE,
  39. INSP_SIZE,
  40. INSP_PERS_SIZE,
  41. CHK_PRJ_SIZE,
  42. FIND_PBLM_SIZE,
  43. ACCN_UNIT_SIZE,
  44. ACCN_PERS_SIZE,
  45. PBLM_MEND_SIZE,
  46. PUB_RPT_SIZE,
  47. CHK_SYS_NOTE,
  48. LEAD_CHK_SIZE,
  49. LEAD_CHK_NOTE,
  50. PERS_ID,
  51. INTM,
  52. UPTM,
  53. DATA_STAT,
  54. AD_CODE
  55. </sql>
  56. <sql id="entity_properties">
  57. #{id},
  58. #{unitName},
  59. #{year},
  60. #{mnth},
  61. #{month},
  62. #{matter},
  63. #{mainWork},
  64. #{spcChkSize},
  65. #{inspSize},
  66. #{inspPersSize},
  67. #{chkPrjSize},
  68. #{findPblmSize},
  69. #{accnUnitSize},
  70. #{accnPersSize},
  71. #{pblmMendSize},
  72. #{pubRptSize},
  73. #{chkSysNote},
  74. #{leadChkSize},
  75. #{leadChkNote},
  76. #{persId},
  77. #{intm},
  78. #{uptm},
  79. #{dataStat},
  80. #{adCode}
  81. </sql>
  82. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  83. <sql id="page_where">
  84. <trim prefix="where" prefixOverrides="and | or ">
  85. <if test="unitName != null and unitName != ''">
  86. and UNIT_NAME = #{unitName}
  87. </if>
  88. <if test="year != null and year != ''">
  89. and YEAR = #{year}
  90. </if>
  91. <if test="mnth != null and mnth != ''">
  92. and MNTH = #{mnth}
  93. </if>
  94. <if test="month != null and month != ''">
  95. <choose>
  96. <when test="month.indexOf('-') > -1">
  97. <foreach item="item" collection="month.split('-')" index="index">
  98. <if test="index == 0">
  99. and cast(MONTH as unsigned) <![CDATA[>=]]> cast(#{item} as unsigned)
  100. </if>
  101. <if test="index == 1">
  102. and cast(MONTH as unsigned) <![CDATA[<=]]> cast(#{item} as unsigned)
  103. </if>
  104. </foreach>
  105. </when>
  106. <otherwise>
  107. and to_number(MONTH) = to_number(#{month})
  108. </otherwise>
  109. </choose>
  110. </if>
  111. <if test="matter != null and matter != ''">
  112. and MATTER = #{matter}
  113. </if>
  114. <if test="mainWork != null and mainWork != ''">
  115. and MAIN_WORK = #{mainWork}
  116. </if>
  117. <if test="spcChkSize != null and spcChkSize != ''">
  118. and SPC_CHK_SIZE = #{spcChkSize}
  119. </if>
  120. <if test="inspSize != null and inspSize != ''">
  121. and INSP_SIZE = #{inspSize}
  122. </if>
  123. <if test="inspPersSize != null and inspPersSize != ''">
  124. and INSP_PERS_SIZE = #{inspPersSize}
  125. </if>
  126. <if test="chkPrjSize != null and chkPrjSize != ''">
  127. and CHK_PRJ_SIZE = #{chkPrjSize}
  128. </if>
  129. <if test="findPblmSize != null and findPblmSize != ''">
  130. and FIND_PBLM_SIZE = #{findPblmSize}
  131. </if>
  132. <if test="accnUnitSize != null and accnUnitSize != ''">
  133. and ACCN_UNIT_SIZE = #{accnUnitSize}
  134. </if>
  135. <if test="accnPersSize != null and accnPersSize != ''">
  136. and ACCN_PERS_SIZE = #{accnPersSize}
  137. </if>
  138. <if test="pblmMendSize != null and pblmMendSize != ''">
  139. and PBLM_MEND_SIZE = #{pblmMendSize}
  140. </if>
  141. <if test="pubRptSize != null and pubRptSize != ''">
  142. and PUB_RPT_SIZE = #{pubRptSize}
  143. </if>
  144. <if test="chkSysNote != null and chkSysNote != ''">
  145. and CHK_SYS_NOTE = #{chkSysNote}
  146. </if>
  147. <if test="leadChkSize != null and leadChkSize != ''">
  148. and LEAD_CHK_SIZE = #{leadChkSize}
  149. </if>
  150. <if test="leadChkNote != null and leadChkNote != ''">
  151. and LEAD_CHK_NOTE = #{leadChkNote}
  152. </if>
  153. <if test="persId != null and persId != ''">
  154. and PERS_ID = #{persId}
  155. </if>
  156. <if test="intm != null">
  157. and INTM = #{intm}
  158. </if>
  159. <if test="uptm != null">
  160. and UPTM = #{uptm}
  161. </if>
  162. <if test="dataStat != null and dataStat != ''">
  163. and DATA_STAT = #{dataStat}
  164. </if>
  165. <if test="adCode != null and adCode != ''">
  166. and AD_CODE like '${adCode}%'
  167. </if>
  168. and DATA_STAT='0'
  169. </trim>
  170. </sql>
  171. <select id="get" resultMap="bisInspMtprgResultMap" parameterType="String">
  172. select
  173. <include refid="table_columns"/>
  174. from BIS_INSP_MTPRG where ID = #{id}
  175. </select>
  176. <select id="getBy" resultMap="bisInspMtprgResultMap">
  177. select
  178. <include refid="table_columns"/>
  179. from BIS_INSP_MTPRG
  180. <include refid="page_where"/>
  181. </select>
  182. <select id="findAll" resultMap="bisInspMtprgResultMap">
  183. select
  184. <include refid="table_columns"/>
  185. from BIS_INSP_MTPRG
  186. </select>
  187. <select id="findList" resultMap="bisInspMtprgResultMap">
  188. select
  189. <include refid="table_columns"/>
  190. from BIS_INSP_MTPRG
  191. <include refid="page_where"/>
  192. </select>
  193. <select id="selectCount" resultType="int">
  194. select count(ID) from BIS_INSP_MTPRG
  195. <include refid="page_where"/>
  196. </select>
  197. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspMtprg">
  198. insert into BIS_INSP_MTPRG(
  199. <include refid="table_columns"/>
  200. )
  201. values (
  202. <include refid="entity_properties"/>
  203. )
  204. </insert>
  205. <delete id="delete" parameterType="java.lang.String">
  206. update BIS_INSP_MTPRG set DATA_STAT='9' where ID = #{id}
  207. </delete>
  208. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMtprg">
  209. update BIS_INSP_MTPRG set DATA_STAT='9'
  210. <include refid="page_where"/>
  211. </delete>
  212. <update id="deleteInFlag" parameterType="java.lang.String">
  213. update BIS_INSP_MTPRG set DATA_STAT = '9' where ID = #{id}
  214. </update>
  215. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspMtprg">
  216. update BIS_INSP_MTPRG
  217. <trim prefix="set" suffixOverrides=",">
  218. <if test="unitName != null and unitName != ''">UNIT_NAME
  219. = #{unitName},
  220. </if>
  221. <if test="year != null and year != ''">YEAR
  222. = #{year},
  223. </if>
  224. <if test="mnth != null and mnth != ''">MNTH
  225. = #{mnth},
  226. </if>
  227. <if test="month != null and month != ''">MONTH
  228. = #{month},
  229. </if>
  230. <if test="matter != null and matter != ''">MATTER
  231. = #{matter},
  232. </if>
  233. <if test="mainWork != null and mainWork != ''">MAIN_WORK
  234. = #{mainWork},
  235. </if>
  236. <if test="spcChkSize != null and spcChkSize != ''">SPC_CHK_SIZE
  237. = #{spcChkSize},
  238. </if>
  239. <if test="inspSize != null and inspSize != ''">INSP_SIZE
  240. = #{inspSize},
  241. </if>
  242. <if test="inspPersSize != null and inspPersSize != ''">INSP_PERS_SIZE
  243. = #{inspPersSize},
  244. </if>
  245. <if test="chkPrjSize != null and chkPrjSize != ''">CHK_PRJ_SIZE
  246. = #{chkPrjSize},
  247. </if>
  248. <if test="findPblmSize != null and findPblmSize != ''">FIND_PBLM_SIZE
  249. = #{findPblmSize},
  250. </if>
  251. <if test="accnUnitSize != null and accnUnitSize != ''">ACCN_UNIT_SIZE
  252. = #{accnUnitSize},
  253. </if>
  254. <if test="accnPersSize != null and accnPersSize != ''">ACCN_PERS_SIZE
  255. = #{accnPersSize},
  256. </if>
  257. <if test="pblmMendSize != null and pblmMendSize != ''">PBLM_MEND_SIZE
  258. = #{pblmMendSize},
  259. </if>
  260. <if test="pubRptSize != null and pubRptSize != ''">PUB_RPT_SIZE
  261. = #{pubRptSize},
  262. </if>
  263. <if test="chkSysNote != null and chkSysNote != ''">CHK_SYS_NOTE
  264. = #{chkSysNote},
  265. </if>
  266. <if test="leadChkSize != null and leadChkSize != ''">LEAD_CHK_SIZE
  267. = #{leadChkSize},
  268. </if>
  269. <if test="leadChkNote != null and leadChkNote != ''">LEAD_CHK_NOTE
  270. = #{leadChkNote},
  271. </if>
  272. <if test="persId != null and persId != ''">PERS_ID
  273. = #{persId},
  274. </if>
  275. <if test="intm != null">INTM
  276. = #{intm},
  277. </if>
  278. <if test="uptm != null">UPTM
  279. = #{uptm},
  280. </if>
  281. <if test="dataStat != null and dataStat != ''">DATA_STAT
  282. = #{dataStat},
  283. </if>
  284. <if test="adCode != null and adCode != ''">AD_CODE
  285. = #{adCode},
  286. </if>
  287. </trim>
  288. <where>ID = #{id}</where>
  289. </update>
  290. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMtprg">
  291. update BIS_INSP_MTPRG
  292. <trim prefix="set" suffixOverrides=",">
  293. <if test="unitName != null and unitName != ''">UNIT_NAME
  294. = #{unitName},
  295. </if>
  296. <if test="year != null and year != ''">YEAR
  297. = #{year},
  298. </if>
  299. <if test="mnth != null and mnth != ''">MNTH
  300. = #{mnth},
  301. </if>
  302. <if test="month != null and month != ''">MONTH
  303. = #{month},
  304. </if>
  305. <if test="matter != null and matter != ''">MATTER
  306. = #{matter},
  307. </if>
  308. <if test="mainWork != null and mainWork != ''">MAIN_WORK
  309. = #{mainWork},
  310. </if>
  311. <if test="spcChkSize != null and spcChkSize != ''">SPC_CHK_SIZE
  312. = #{spcChkSize},
  313. </if>
  314. <if test="inspSize != null and inspSize != ''">INSP_SIZE
  315. = #{inspSize},
  316. </if>
  317. <if test="inspPersSize != null and inspPersSize != ''">INSP_PERS_SIZE
  318. = #{inspPersSize},
  319. </if>
  320. <if test="chkPrjSize != null and chkPrjSize != ''">CHK_PRJ_SIZE
  321. = #{chkPrjSize},
  322. </if>
  323. <if test="findPblmSize != null and findPblmSize != ''">FIND_PBLM_SIZE
  324. = #{findPblmSize},
  325. </if>
  326. <if test="accnUnitSize != null and accnUnitSize != ''">ACCN_UNIT_SIZE
  327. = #{accnUnitSize},
  328. </if>
  329. <if test="accnPersSize != null and accnPersSize != ''">ACCN_PERS_SIZE
  330. = #{accnPersSize},
  331. </if>
  332. <if test="pblmMendSize != null and pblmMendSize != ''">PBLM_MEND_SIZE
  333. = #{pblmMendSize},
  334. </if>
  335. <if test="pubRptSize != null and pubRptSize != ''">PUB_RPT_SIZE
  336. = #{pubRptSize},
  337. </if>
  338. <if test="chkSysNote != null and chkSysNote != ''">CHK_SYS_NOTE
  339. = #{chkSysNote},
  340. </if>
  341. <if test="leadChkSize != null and leadChkSize != ''">LEAD_CHK_SIZE
  342. = #{leadChkSize},
  343. </if>
  344. <if test="leadChkNote != null and leadChkNote != ''">LEAD_CHK_NOTE
  345. = #{leadChkNote},
  346. </if>
  347. <if test="persId != null and persId != ''">PERS_ID
  348. = #{persId},
  349. </if>
  350. <if test="intm != null">INTM
  351. = #{intm},
  352. </if>
  353. <if test="uptm != null">UPTM
  354. = #{uptm},
  355. </if>
  356. <if test="dataStat != null and dataStat != ''">DATA_STAT
  357. = #{dataStat},
  358. </if>
  359. <if test="adCode != null and adCode != ''">AD_CODE
  360. = #{adCode},
  361. </if>
  362. </trim>
  363. <include refid="page_where"/>
  364. </update>
  365. <!-- 其他自定义SQL -->
  366. </mapper>