BisInspKeychkqhUnitDao.xml 8.7 KB

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