BisInspXjvillRegmDao.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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.BisInspXjvillRegmDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspXjvillRegm" id="bisInspXjvillRegmResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="rgstrId" column="RGSTR_ID"/>
  7. <result property="nm" column="NM"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="adName" column="AD_NAME"/>
  10. <result property="persId" column="PERS_ID"/>
  11. <result property="intm" column="INTM"/>
  12. <result property="uptm" column="UPTM"/>
  13. <result property="note" column="NOTE"/>
  14. <result property="dataStat" column="DATA_STAT"/>
  15. </resultMap>
  16. <sql id="table_columns">
  17. ID,
  18. RGSTR_ID,
  19. NM,
  20. AD_CODE,
  21. AD_NAME,
  22. PERS_ID,
  23. INTM,
  24. UPTM,
  25. NOTE,
  26. DATA_STAT
  27. </sql>
  28. <sql id="entity_properties">
  29. #{id},
  30. #{rgstrId},
  31. #{nm},
  32. #{adCode},
  33. #{adName},
  34. #{persId},
  35. #{intm},
  36. #{uptm},
  37. #{note},
  38. #{dataStat}
  39. </sql>
  40. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  41. <sql id="page_where">
  42. <trim prefix="where" prefixOverrides="and | or ">
  43. <if test="rgstrId != null and rgstrId != ''">
  44. and RGSTR_ID = #{rgstrId}
  45. </if>
  46. <if test="nm != null and nm != ''">
  47. and NM = #{nm}
  48. </if>
  49. <if test="adCode != null and adCode != ''">
  50. and AD_CODE = #{adCode}
  51. </if>
  52. <if test="adName != null and adName != ''">
  53. and AD_NAME = #{adName}
  54. </if>
  55. <if test="persId != null and persId != ''">
  56. and PERS_ID = #{persId}
  57. </if>
  58. <if test="intm != null">
  59. and INTM = #{intm}
  60. </if>
  61. <if test="uptm != null">
  62. and UPTM = #{uptm}
  63. </if>
  64. <if test="note != null and note != ''">
  65. and NOTE = #{note}
  66. </if>
  67. <if test="dataStat != null and dataStat != ''">
  68. and DATA_STAT = #{dataStat}
  69. </if>
  70. and DATA_STAT='0'
  71. </trim>
  72. </sql>
  73. <select id="get" resultMap="bisInspXjvillRegmResultMap" parameterType="String">
  74. select
  75. <include refid="table_columns"/>
  76. from BIS_INSP_XJVILL_REGM where ID = #{id}
  77. </select>
  78. <select id="getBy" resultMap="bisInspXjvillRegmResultMap">
  79. select
  80. <include refid="table_columns"/>
  81. from BIS_INSP_XJVILL_REGM
  82. <include refid="page_where"/>
  83. </select>
  84. <select id="findAll" resultMap="bisInspXjvillRegmResultMap">
  85. select
  86. <include refid="table_columns"/>
  87. from BIS_INSP_XJVILL_REGM
  88. </select>
  89. <select id="findList" resultMap="bisInspXjvillRegmResultMap">
  90. select
  91. <include refid="table_columns"/>
  92. from BIS_INSP_XJVILL_REGM
  93. <include refid="page_where"/>
  94. </select>
  95. <select id="selectCount" resultType="int">
  96. select count(ID) from BIS_INSP_XJVILL_REGM
  97. <include refid="page_where"/>
  98. </select>
  99. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspXjvillRegm">
  100. insert into BIS_INSP_XJVILL_REGM(
  101. <include refid="table_columns"/>
  102. )
  103. values (
  104. <include refid="entity_properties"/>
  105. )
  106. </insert>
  107. <delete id="delete" parameterType="java.lang.String">
  108. update BIS_INSP_XJVILL_REGM set DATA_STAT='9' where ID = #{id}
  109. </delete>
  110. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspXjvillRegm">
  111. update BIS_INSP_XJVILL_REGM set DATA_STAT='9'
  112. <include refid="page_where"/>
  113. </delete>
  114. <update id="deleteInFlag" parameterType="java.lang.String">
  115. update BIS_INSP_XJVILL_REGM set DATA_STAT = '9' where ID = #{id}
  116. </update>
  117. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspXjvillRegm">
  118. update BIS_INSP_XJVILL_REGM
  119. <trim prefix="set" suffixOverrides=",">
  120. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  121. = #{rgstrId},
  122. </if>
  123. <if test="nm != null and nm != ''">NM
  124. = #{nm},
  125. </if>
  126. <if test="adCode != null and adCode != ''">AD_CODE
  127. = #{adCode},
  128. </if>
  129. <if test="adName != null and adName != ''">AD_NAME
  130. = #{adName},
  131. </if>
  132. <if test="persId != null and persId != ''">PERS_ID
  133. = #{persId},
  134. </if>
  135. <if test="intm != null">INTM
  136. = #{intm},
  137. </if>
  138. <if test="uptm != null">UPTM
  139. = #{uptm},
  140. </if>
  141. <if test="note != null and note != ''">NOTE
  142. = #{note},
  143. </if>
  144. <if test="dataStat != null and dataStat != ''">DATA_STAT
  145. = #{dataStat},
  146. </if>
  147. </trim>
  148. <where>ID = #{id}</where>
  149. </update>
  150. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspXjvillRegm">
  151. update BIS_INSP_XJVILL_REGM
  152. <trim prefix="set" suffixOverrides=",">
  153. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  154. = #{rgstrId},
  155. </if>
  156. <if test="nm != null and nm != ''">NM
  157. = #{nm},
  158. </if>
  159. <if test="adCode != null and adCode != ''">AD_CODE
  160. = #{adCode},
  161. </if>
  162. <if test="adName != null and adName != ''">AD_NAME
  163. = #{adName},
  164. </if>
  165. <if test="persId != null and persId != ''">PERS_ID
  166. = #{persId},
  167. </if>
  168. <if test="intm != null">INTM
  169. = #{intm},
  170. </if>
  171. <if test="uptm != null">UPTM
  172. = #{uptm},
  173. </if>
  174. <if test="note != null and note != ''">NOTE
  175. = #{note},
  176. </if>
  177. <if test="dataStat != null and dataStat != ''">DATA_STAT
  178. = #{dataStat},
  179. </if>
  180. </trim>
  181. <include refid="page_where"/>
  182. </update>
  183. <!-- 其他自定义SQL -->
  184. <select id="findListNotIn" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
  185. select * FROM ATT_AD_BASE WHERE
  186. AD_FCODE = #{adCode}
  187. AND AD_CODE NOT IN (
  188. SELECT AD_CODE FROM BIS_INSP_XJVILL_REGM WHERE RGSTR_ID = #{rgstrId} AND DATA_STAT = '0'
  189. )
  190. </select>
  191. </mapper>