BisInspVillgdWtspSrcDao.xml 8.5 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.BisInspVillgdWtspSrcDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspVillgdWtspSrc" id="bisInspVillgdWtspSrcResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="wtspId" column="WTSP_ID"/>
  7. <result property="rgstrId" column="RGSTR_ID"/>
  8. <result property="isSureRange" column="IS_SURE_RANGE"/>
  9. <result property="isSetLog" column="IS_SET_LOG"/>
  10. <result property="isSetOut" column="IS_SET_OUT"/>
  11. <result property="isPatrol" column="IS_PATROL"/>
  12. <result property="isFindPblm" column="IS_FIND_PBLM"/>
  13. <result property="persId" column="PERS_ID"/>
  14. <result property="intm" column="INTM"/>
  15. <result property="uptm" column="UPTM"/>
  16. <result property="note" column="NOTE"/>
  17. <result property="dataStat" column="DATA_STAT"/>
  18. <result property="state" column="STATE"/>
  19. </resultMap>
  20. <sql id="table_columns">
  21. ID,
  22. WTSP_ID,
  23. RGSTR_ID,
  24. IS_SURE_RANGE,
  25. IS_SET_LOG,
  26. IS_SET_OUT,
  27. IS_PATROL,
  28. IS_FIND_PBLM,
  29. PERS_ID,
  30. INTM,
  31. UPTM,
  32. NOTE,
  33. DATA_STAT,
  34. STATE
  35. </sql>
  36. <sql id="entity_properties">
  37. #{id},
  38. #{wtspId},
  39. #{rgstrId},
  40. #{isSureRange},
  41. #{isSetLog},
  42. #{isSetOut},
  43. #{isPatrol},
  44. #{isFindPblm},
  45. #{persId},
  46. #{intm},
  47. #{uptm},
  48. #{note},
  49. #{dataStat},
  50. #{state}
  51. </sql>
  52. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  53. <sql id="page_where">
  54. <trim prefix="where" prefixOverrides="and | or ">
  55. <if test="wtspId != null and wtspId != ''">
  56. and WTSP_ID = #{wtspId}
  57. </if>
  58. <if test="rgstrId != null and rgstrId != ''">
  59. and RGSTR_ID = #{rgstrId}
  60. </if>
  61. <if test="isSureRange != null and isSureRange != ''">
  62. and IS_SURE_RANGE = #{isSureRange}
  63. </if>
  64. <if test="isSetLog != null and isSetLog != ''">
  65. and IS_SET_LOG = #{isSetLog}
  66. </if>
  67. <if test="isSetOut != null and isSetOut != ''">
  68. and IS_SET_OUT = #{isSetOut}
  69. </if>
  70. <if test="isPatrol != null and isPatrol != ''">
  71. and IS_PATROL = #{isPatrol}
  72. </if>
  73. <if test="isFindPblm != null and isFindPblm != ''">
  74. and IS_FIND_PBLM = #{isFindPblm}
  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="note != null and note != ''">
  86. and NOTE = #{note}
  87. </if>
  88. <if test="dataStat != null and dataStat != ''">
  89. and DATA_STAT = #{dataStat}
  90. </if>
  91. <if test="state != null and state != ''">
  92. and STATE = #{state}
  93. </if>
  94. and DATA_STAT='0'
  95. </trim>
  96. </sql>
  97. <select id="get" resultMap="bisInspVillgdWtspSrcResultMap" parameterType="String">
  98. select
  99. <include refid="table_columns"/>
  100. from BIS_INSP_VILLGD_WTSP_SRC where WTSP_ID = #{id}
  101. </select>
  102. <select id="getBy" resultMap="bisInspVillgdWtspSrcResultMap">
  103. select
  104. <include refid="table_columns"/>
  105. from BIS_INSP_VILLGD_WTSP_SRC
  106. <include refid="page_where"/>
  107. </select>
  108. <select id="findAll" resultMap="bisInspVillgdWtspSrcResultMap">
  109. select
  110. <include refid="table_columns"/>
  111. from BIS_INSP_VILLGD_WTSP_SRC
  112. </select>
  113. <select id="findList" resultMap="bisInspVillgdWtspSrcResultMap">
  114. select
  115. <include refid="table_columns"/>
  116. from BIS_INSP_VILLGD_WTSP_SRC
  117. <include refid="page_where"/>
  118. </select>
  119. <select id="selectCount" resultType="int">
  120. select count(ID) from BIS_INSP_VILLGD_WTSP_SRC
  121. <include refid="page_where"/>
  122. </select>
  123. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspVillgdWtspSrc">
  124. insert into BIS_INSP_VILLGD_WTSP_SRC(
  125. <include refid="table_columns"/>
  126. )
  127. values (
  128. <include refid="entity_properties"/>
  129. )
  130. </insert>
  131. <delete id="delete" parameterType="java.lang.String">
  132. update BIS_INSP_VILLGD_WTSP_SRC set DATA_STAT='9' where ID = #{id}
  133. </delete>
  134. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspVillgdWtspSrc">
  135. update BIS_INSP_VILLGD_WTSP_SRC set DATA_STAT='9'
  136. <include refid="page_where"/>
  137. </delete>
  138. <update id="deleteInFlag" parameterType="java.lang.String">
  139. update BIS_INSP_VILLGD_WTSP_SRC set DATA_STAT = '9' where ID = #{id}
  140. </update>
  141. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspVillgdWtspSrc">
  142. update BIS_INSP_VILLGD_WTSP_SRC
  143. <trim prefix="set" suffixOverrides=",">
  144. <if test="wtspId != null and wtspId != ''">WTSP_ID
  145. = #{wtspId},
  146. </if>
  147. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  148. = #{rgstrId},
  149. </if>
  150. <if test="isSureRange != null and isSureRange != ''">IS_SURE_RANGE
  151. = #{isSureRange},
  152. </if>
  153. <if test="isSetLog != null and isSetLog != ''">IS_SET_LOG
  154. = #{isSetLog},
  155. </if>
  156. <if test="isSetOut != null and isSetOut != ''">IS_SET_OUT
  157. = #{isSetOut},
  158. </if>
  159. <if test="isPatrol != null and isPatrol != ''">IS_PATROL
  160. = #{isPatrol},
  161. </if>
  162. <if test="isFindPblm != null and isFindPblm != ''">IS_FIND_PBLM
  163. = #{isFindPblm},
  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. <if test="state != null and state != ''">
  181. STATE = #{state},
  182. </if>
  183. </trim>
  184. <where>ID = #{id}</where>
  185. </update>
  186. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspVillgdWtspSrc">
  187. update BIS_INSP_VILLGD_WTSP_SRC
  188. <trim prefix="set" suffixOverrides=",">
  189. <if test="wtspId != null and wtspId != ''">WTSP_ID
  190. = #{wtspId},
  191. </if>
  192. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  193. = #{rgstrId},
  194. </if>
  195. <if test="isSureRange != null and isSureRange != ''">IS_SURE_RANGE
  196. = #{isSureRange},
  197. </if>
  198. <if test="isSetLog != null and isSetLog != ''">IS_SET_LOG
  199. = #{isSetLog},
  200. </if>
  201. <if test="isSetOut != null and isSetOut != ''">IS_SET_OUT
  202. = #{isSetOut},
  203. </if>
  204. <if test="isPatrol != null and isPatrol != ''">IS_PATROL
  205. = #{isPatrol},
  206. </if>
  207. <if test="isFindPblm != null and isFindPblm != ''">IS_FIND_PBLM
  208. = #{isFindPblm},
  209. </if>
  210. <if test="persId != null and persId != ''">PERS_ID
  211. = #{persId},
  212. </if>
  213. <if test="intm != null">INTM
  214. = #{intm},
  215. </if>
  216. <if test="uptm != null">UPTM
  217. = #{uptm},
  218. </if>
  219. <if test="note != null and note != ''">NOTE
  220. = #{note},
  221. </if>
  222. <if test="dataStat != null and dataStat != ''">DATA_STAT
  223. = #{dataStat},
  224. </if>
  225. <if test="state != null and state != ''">
  226. STATE = #{state},
  227. </if>
  228. </trim>
  229. <include refid="page_where"/>
  230. </update>
  231. <!-- 其他自定义SQL -->
  232. </mapper>