BisInspVillgdWtspOthrDao.xml 7.0 KB

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