BisInspPlanChkDao.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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.BisInspPlanChkDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPlanChk" id="bisInspPlanChkResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="adCode" column="AD_CODE"/>
  7. <result property="chkYear" column="CHK_YEAR"/>
  8. <result property="chkItem" column="CHK_ITEM"/>
  9. <result property="chkMatter" column="CHK_MATTER"/>
  10. <result property="chkBatch" column="CHK_BATCH"/>
  11. <result property="chkTm" column="CHK_TM"/>
  12. <result property="chkCity" column="CHK_CITY"/>
  13. <result property="chkCounty" column="CHK_COUNTY"/>
  14. <result property="chkContent" column="CHK_CONTENT"/>
  15. <result property="chkDep" column="CHK_DEP"/>
  16. <result property="chkType" column="CHK_TYPE"/>
  17. <result property="persId" column="PERS_ID"/>
  18. <result property="intm" column="INTM"/>
  19. <result property="uptm" column="UPTM"/>
  20. <result property="dataStat" column="DATA_STAT"/>
  21. </resultMap>
  22. <sql id="table_columns">
  23. ID,
  24. AD_CODE,
  25. CHK_YEAR,
  26. CHK_ITEM,
  27. CHK_MATTER,
  28. CHK_BATCH,
  29. CHK_TM,
  30. CHK_CITY,
  31. CHK_COUNTY,
  32. CHK_CONTENT,
  33. CHK_DEP,
  34. CHK_TYPE,
  35. PERS_ID,
  36. INTM,
  37. UPTM,
  38. DATA_STAT
  39. </sql>
  40. <sql id="entity_properties">
  41. #{id},
  42. #{adCode},
  43. #{chkYear},
  44. #{chkItem},
  45. #{chkMatter},
  46. #{chkBatch},
  47. #{chkTm},
  48. #{chkCity},
  49. #{chkCounty},
  50. #{chkContent},
  51. #{chkDep},
  52. #{chkType},
  53. #{persId},
  54. #{intm},
  55. #{uptm},
  56. #{dataStat}
  57. </sql>
  58. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  59. <sql id="page_where">
  60. <trim prefix="where" prefixOverrides="and | or ">
  61. <if test="chkYear != null and chkYear != ''">and CHK_YEAR = #{chkYear}</if>
  62. <if test="adCode != null and adCode != ''">and AD_CODE LIKE '${adCode}%'</if>
  63. <if test="chkItem != null and chkItem != ''">and CHK_ITEM LIKE '%${chkItem}%'</if>
  64. <if test="chkMatter != null and chkMatter != ''">
  65. and CHK_MATTER LIKE '%${chkMatter}%'</if>
  66. <if test="chkBatch != null and chkBatch != ''">
  67. and CHK_BATCH = #{chkBatch}</if>
  68. <if test="chkTm != null and chkTm != ''">
  69. and CHK_TM = #{chkTm}</if>
  70. <if test="chkCity != null and chkCity != ''">
  71. and CHK_CITY = #{chkCity}</if>
  72. <if test="chkCounty != null and chkCounty != ''">
  73. and CHK_COUNTY = #{chkCounty}</if>
  74. <if test="chkContent != null and chkContent != ''">
  75. and CHK_CONTENT = #{chkContent}</if>
  76. <if test="chkDep != null and chkDep != ''">
  77. and CHK_DEP LIKE '%${chkDep}%'</if>
  78. <if test="chkType != null and chkType != ''">
  79. and CHK_TYPE = #{chkType}
  80. </if>
  81. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  82. <if test="intm != null">and INTM = #{intm}</if>
  83. <if test="uptm != null">and UPTM = #{uptm}</if>
  84. <if test="dataStat != null and dataStat != ''">
  85. and DATA_STAT = #{dataStat}</if>
  86. and DATA_STAT='0'
  87. </trim>
  88. </sql>
  89. <select id="get" resultMap="bisInspPlanChkResultMap" parameterType="String">
  90. select
  91. <include refid="table_columns"/>
  92. from BIS_INSP_PLAN_CHK where ID = #{id}
  93. </select>
  94. <select id="getBy" resultMap="bisInspPlanChkResultMap">
  95. select
  96. <include refid="table_columns"/>
  97. from BIS_INSP_PLAN_CHK
  98. <include refid="page_where"/>
  99. </select>
  100. <select id="findAll" resultMap="bisInspPlanChkResultMap">
  101. select
  102. <include refid="table_columns"/>
  103. from BIS_INSP_PLAN_CHK
  104. </select>
  105. <select id="findList" resultMap="bisInspPlanChkResultMap">
  106. select
  107. <include refid="table_columns"/>
  108. from BIS_INSP_PLAN_CHK
  109. <include refid="page_where"/>
  110. </select>
  111. <select id="selectCount" resultType="int">
  112. select count(ID) from BIS_INSP_PLAN_CHK
  113. <include refid="page_where"/>
  114. </select>
  115. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanChk">
  116. insert into BIS_INSP_PLAN_CHK(
  117. <include refid="table_columns"/>
  118. )
  119. values (
  120. <include refid="entity_properties"/>
  121. )
  122. </insert>
  123. <delete id="delete" parameterType="java.lang.String">
  124. update BIS_INSP_PLAN_CHK set DATA_STAT='9' where ID = #{id}
  125. </delete>
  126. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanChk">
  127. update BIS_INSP_PLAN_CHK set DATA_STAT='9'
  128. <include refid="page_where"/>
  129. </delete>
  130. <update id="deleteInFlag" parameterType="java.lang.String">
  131. update BIS_INSP_PLAN_CHK set DATA_STAT = '9' where ID = #{id}
  132. </update>
  133. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanChk">
  134. update BIS_INSP_PLAN_CHK
  135. <trim prefix="set" suffixOverrides=",">
  136. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  137. <if test="chkYear != null and chkYear != ''">CHK_YEAR
  138. = #{chkYear},
  139. </if>
  140. <if test="chkItem != null and chkItem != ''">CHK_ITEM
  141. = #{chkItem},
  142. </if>
  143. <if test="chkMatter != null and chkMatter != ''">CHK_MATTER
  144. = #{chkMatter},
  145. </if>
  146. <if test="chkBatch != null and chkBatch != ''">CHK_BATCH
  147. = #{chkBatch},
  148. </if>
  149. <if test="chkTm != null and chkTm != ''">CHK_TM
  150. = #{chkTm},
  151. </if>
  152. <if test="chkCity != null and chkCity != ''">CHK_CITY
  153. = #{chkCity},
  154. </if>
  155. <if test="chkCounty != null and chkCounty != ''">CHK_COUNTY
  156. = #{chkCounty},
  157. </if>
  158. <if test="chkContent != null and chkContent != ''">CHK_CONTENT
  159. = #{chkContent},
  160. </if>
  161. <if test="chkDep != null and chkDep != ''">CHK_DEP
  162. = #{chkDep},
  163. </if>
  164. <if test="chkType != null and chkType != ''">CHK_TYPE
  165. = #{chkType},
  166. </if>
  167. <if test="persId != null and persId != ''">PERS_ID
  168. = #{persId},
  169. </if>
  170. <if test="intm != null">INTM
  171. = #{intm},
  172. </if>
  173. <if test="uptm != null">UPTM
  174. = #{uptm},
  175. </if>
  176. <if test="dataStat != null and dataStat != ''">DATA_STAT
  177. = #{dataStat},
  178. </if>
  179. </trim>
  180. <where>ID = #{id}</where>
  181. </update>
  182. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanChk">
  183. update BIS_INSP_PLAN_CHK
  184. <trim prefix="set" suffixOverrides=",">
  185. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  186. <if test="chkYear != null and chkYear != ''">CHK_YEAR
  187. = #{chkYear},
  188. </if>
  189. <if test="chkItem != null and chkItem != ''">CHK_ITEM
  190. = #{chkItem},
  191. </if>
  192. <if test="chkMatter != null and chkMatter != ''">CHK_MATTER
  193. = #{chkMatter},
  194. </if>
  195. <if test="chkBatch != null and chkBatch != ''">CHK_BATCH
  196. = #{chkBatch},
  197. </if>
  198. <if test="chkTm != null and chkTm != ''">CHK_TM
  199. = #{chkTm},
  200. </if>
  201. <if test="chkCity != null and chkCity != ''">CHK_CITY
  202. = #{chkCity},
  203. </if>
  204. <if test="chkCounty != null and chkCounty != ''">CHK_COUNTY
  205. = #{chkCounty},
  206. </if>
  207. <if test="chkContent != null and chkContent != ''">CHK_CONTENT
  208. = #{chkContent},
  209. </if>
  210. <if test="chkDep != null and chkDep != ''">CHK_DEP
  211. = #{chkDep},
  212. </if>
  213. <if test="chkType != null and chkType != ''">CHK_TYPE
  214. = #{chkType},
  215. </if>
  216. <if test="persId != null and persId != ''">PERS_ID
  217. = #{persId},
  218. </if>
  219. <if test="intm != null">INTM
  220. = #{intm},
  221. </if>
  222. <if test="uptm != null">UPTM
  223. = #{uptm},
  224. </if>
  225. <if test="dataStat != null and dataStat != ''">DATA_STAT
  226. = #{dataStat},
  227. </if>
  228. </trim>
  229. <include refid="page_where"/>
  230. </update>
  231. <!-- 其他自定义SQL -->
  232. </mapper>