BisInspChmclsUseunitwkDao.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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.BisInspChmclsUseunitwkDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspChmclsUseunitwk" id="bisInspChmclsUseunitwkResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="rgstrId" column="RGSTR_ID"/>
  7. <result property="depName" column="DEP_NAME"/>
  8. <result property="adCode" column="AD_CODE"/>
  9. <result property="adName" column="AD_NAME"/>
  10. <result property="depPers" column="DEP_PERS"/>
  11. <result property="depPersTel" column="DEP_PERS_TEL"/>
  12. <result property="utLead" column="UT_LEAD"/>
  13. <result property="principalTel" column="PRINCIPAL_TEL"/>
  14. <result property="isBuldAch" column="IS_BULD_ACH"/>
  15. <result property="isRegSys" column="IS_REG_SYS"/>
  16. <result property="isDngInfo" column="IS_DNG_INFO"/>
  17. <result property="isSafMsu" column="IS_SAF_MSU"/>
  18. <result property="isUsrGvm" column="IS_USR_GVM"/>
  19. <result property="persId" column="PERS_ID"/>
  20. <result property="intm" column="INTM"/>
  21. <result property="uptm" column="UPTM"/>
  22. <result property="note" column="NOTE"/>
  23. <result property="dataStat" column="DATA_STAT"/>
  24. <result property="state" column="STATE"/>
  25. <result property="loc" column="LOC"/>
  26. </resultMap>
  27. <sql id="table_columns">
  28. ID,
  29. RGSTR_ID,
  30. DEP_NAME,
  31. AD_CODE,
  32. AD_NAME,
  33. DEP_PERS,
  34. DEP_PERS_TEL,
  35. UT_LEAD,
  36. PRINCIPAL_TEL,
  37. IS_BULD_ACH,
  38. IS_REG_SYS,
  39. IS_DNG_INFO,
  40. IS_SAF_MSU,
  41. IS_USR_GVM,
  42. PERS_ID,
  43. INTM,
  44. UPTM,
  45. NOTE,
  46. DATA_STAT,
  47. STATE,
  48. LOC
  49. </sql>
  50. <sql id="entity_properties">
  51. #{id},
  52. #{rgstrId},
  53. #{depName},
  54. #{adCode},
  55. #{adName},
  56. #{depPers},
  57. #{depPersTel},
  58. #{utLead},
  59. #{principalTel},
  60. #{isBuldAch},
  61. #{isRegSys},
  62. #{isDngInfo},
  63. #{isSafMsu},
  64. #{isUsrGvm},
  65. #{persId},
  66. #{intm},
  67. #{uptm},
  68. #{note},
  69. #{dataStat},
  70. #{state},
  71. #{loc}
  72. </sql>
  73. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  74. <sql id="page_where">
  75. <trim prefix="where" prefixOverrides="and | or ">
  76. <if test="rgstrId != null and rgstrId != ''">
  77. and RGSTR_ID = #{rgstrId}
  78. </if>
  79. <if test="depName != null and depName != ''">
  80. and DEP_NAME = #{depName}
  81. </if>
  82. <if test="adCode != null and adCode != ''">
  83. and AD_CODE = #{adCode}
  84. </if>
  85. <if test="adName != null and adName != ''">
  86. and AD_NAME = #{adName}
  87. </if>
  88. <if test="depPers != null and depPers != ''">
  89. and DEP_PERS = #{depPers}
  90. </if>
  91. <if test="depPersTel != null and depPersTel != ''">
  92. and DEP_PERS_TEL = #{depPersTel}
  93. </if>
  94. <if test="utLead != null and utLead != ''">
  95. and UT_LEAD = #{utLead}
  96. </if>
  97. <if test="principalTel != null and principalTel != ''">
  98. and PRINCIPAL_TEL = #{principalTel}
  99. </if>
  100. <if test="isBuldAch != null and isBuldAch != ''">
  101. and IS_BULD_ACH = #{isBuldAch}
  102. </if>
  103. <if test="isRegSys != null and isRegSys != ''">
  104. and IS_REG_SYS = #{isRegSys}
  105. </if>
  106. <if test="isDngInfo != null and isDngInfo != ''">
  107. and IS_DNG_INFO = #{isDngInfo}
  108. </if>
  109. <if test="isSafMsu != null and isSafMsu != ''">
  110. and IS_SAF_MSU = #{isSafMsu}
  111. </if>
  112. <if test="isUsrGvm != null and isUsrGvm != ''">
  113. and IS_USR_GVM = #{isUsrGvm}
  114. </if>
  115. <if test="persId != null and persId != ''">
  116. and PERS_ID = #{persId}
  117. </if>
  118. <if test="intm != null">
  119. and INTM = #{intm}
  120. </if>
  121. <if test="uptm != null">
  122. and UPTM = #{uptm}
  123. </if>
  124. <if test="note != null and note != ''">
  125. and NOTE = #{note}
  126. </if>
  127. <if test="dataStat != null and dataStat != ''">
  128. and DATA_STAT = #{dataStat}
  129. </if>
  130. <if test="state != null and state != ''">
  131. and STATE = #{state}
  132. </if>
  133. <if test="loc != null and loc != ''">
  134. and LOC = #{loc}
  135. </if>
  136. and DATA_STAT='0'
  137. </trim>
  138. </sql>
  139. <select id="get" resultMap="bisInspChmclsUseunitwkResultMap" parameterType="String">
  140. select
  141. <include refid="table_columns"/>
  142. from BIS_INSP_CHMCLS_USEUNITWK where ID = #{id}
  143. </select>
  144. <select id="getBy" resultMap="bisInspChmclsUseunitwkResultMap">
  145. select
  146. <include refid="table_columns"/>
  147. from BIS_INSP_CHMCLS_USEUNITWK
  148. <include refid="page_where"/>
  149. </select>
  150. <select id="findAll" resultMap="bisInspChmclsUseunitwkResultMap">
  151. select
  152. <include refid="table_columns"/>
  153. from BIS_INSP_CHMCLS_USEUNITWK
  154. </select>
  155. <select id="findList" resultMap="bisInspChmclsUseunitwkResultMap">
  156. SELECT B.*, A.AD_FULL_NAME
  157. FROM (
  158. select
  159. <include refid="table_columns"/>
  160. from BIS_INSP_CHMCLS_USEUNITWK
  161. <include refid="page_where"/>
  162. ) B LEFT JOIN ATT_AD_BASE A ON B.AD_CODE = A.AD_CODE
  163. </select>
  164. <select id="selectCount" resultType="int">
  165. select count(ID) from BIS_INSP_CHMCLS_USEUNITWK
  166. <include refid="page_where"/>
  167. </select>
  168. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspChmclsUseunitwk">
  169. insert into BIS_INSP_CHMCLS_USEUNITWK(
  170. <include refid="table_columns"/>
  171. )
  172. values (
  173. <include refid="entity_properties"/>
  174. )
  175. </insert>
  176. <delete id="delete" parameterType="java.lang.String">
  177. update BIS_INSP_CHMCLS_USEUNITWK set DATA_STAT='9' where ID = #{id}
  178. </delete>
  179. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspChmclsUseunitwk">
  180. update BIS_INSP_CHMCLS_USEUNITWK set DATA_STAT='9'
  181. <include refid="page_where"/>
  182. </delete>
  183. <update id="deleteInFlag" parameterType="java.lang.String">
  184. update BIS_INSP_CHMCLS_USEUNITWK set DATA_STAT = '9' where ID = #{id}
  185. </update>
  186. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspChmclsUseunitwk">
  187. update BIS_INSP_CHMCLS_USEUNITWK
  188. <trim prefix="set" suffixOverrides=",">
  189. <if test="loc != null and loc != ''">
  190. LOC = #{loc},
  191. </if>
  192. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  193. = #{rgstrId},
  194. </if>
  195. <if test="depName != null and depName != ''">DEP_NAME
  196. = #{depName},
  197. </if>
  198. <if test="adCode != null and adCode != ''">AD_CODE
  199. = #{adCode},
  200. </if>
  201. <if test="adName != null and adName != ''">AD_NAME
  202. = #{adName},
  203. </if>
  204. <if test="depPers != null and depPers != ''">DEP_PERS
  205. = #{depPers},
  206. </if>
  207. <if test="depPersTel != null and depPersTel != ''">DEP_PERS_TEL
  208. = #{depPersTel},
  209. </if>
  210. <if test="utLead != null and utLead != ''">UT_LEAD
  211. = #{utLead},
  212. </if>
  213. <if test="principalTel != null and principalTel != ''">PRINCIPAL_TEL
  214. = #{principalTel},
  215. </if>
  216. <if test="isBuldAch != null and isBuldAch != ''">IS_BULD_ACH
  217. = #{isBuldAch},
  218. </if>
  219. <if test="isRegSys != null and isRegSys != ''">IS_REG_SYS
  220. = #{isRegSys},
  221. </if>
  222. <if test="isDngInfo != null and isDngInfo != ''">IS_DNG_INFO
  223. = #{isDngInfo},
  224. </if>
  225. <if test="isSafMsu != null and isSafMsu != ''">IS_SAF_MSU
  226. = #{isSafMsu},
  227. </if>
  228. <if test="isUsrGvm != null and isUsrGvm != ''">IS_USR_GVM
  229. = #{isUsrGvm},
  230. </if>
  231. <if test="persId != null and persId != ''">PERS_ID
  232. = #{persId},
  233. </if>
  234. <if test="intm != null">INTM
  235. = #{intm},
  236. </if>
  237. <if test="uptm != null">UPTM
  238. = #{uptm},
  239. </if>
  240. <if test="note != null and note != ''">NOTE
  241. = #{note},
  242. </if>
  243. <if test="dataStat != null and dataStat != ''">DATA_STAT
  244. = #{dataStat},
  245. </if>
  246. <if test="state != null and state != ''">STATE
  247. = #{state},
  248. </if>
  249. </trim>
  250. <where>ID = #{id}</where>
  251. </update>
  252. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspChmclsUseunitwk">
  253. update BIS_INSP_CHMCLS_USEUNITWK
  254. <trim prefix="set" suffixOverrides=",">
  255. <if test="loc != null and loc != ''">
  256. LOC = #{loc},
  257. </if>
  258. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  259. = #{rgstrId},
  260. </if>
  261. <if test="depName != null and depName != ''">DEP_NAME
  262. = #{depName},
  263. </if>
  264. <if test="adCode != null and adCode != ''">AD_CODE
  265. = #{adCode},
  266. </if>
  267. <if test="adName != null and adName != ''">AD_NAME
  268. = #{adName},
  269. </if>
  270. <if test="depPers != null and depPers != ''">DEP_PERS
  271. = #{depPers},
  272. </if>
  273. <if test="depPersTel != null and depPersTel != ''">DEP_PERS_TEL
  274. = #{depPersTel},
  275. </if>
  276. <if test="utLead != null and utLead != ''">UT_LEAD
  277. = #{utLead},
  278. </if>
  279. <if test="principalTel != null and principalTel != ''">PRINCIPAL_TEL
  280. = #{principalTel},
  281. </if>
  282. <if test="isBuldAch != null and isBuldAch != ''">IS_BULD_ACH
  283. = #{isBuldAch},
  284. </if>
  285. <if test="isRegSys != null and isRegSys != ''">IS_REG_SYS
  286. = #{isRegSys},
  287. </if>
  288. <if test="isDngInfo != null and isDngInfo != ''">IS_DNG_INFO
  289. = #{isDngInfo},
  290. </if>
  291. <if test="isSafMsu != null and isSafMsu != ''">IS_SAF_MSU
  292. = #{isSafMsu},
  293. </if>
  294. <if test="isUsrGvm != null and isUsrGvm != ''">IS_USR_GVM
  295. = #{isUsrGvm},
  296. </if>
  297. <if test="persId != null and persId != ''">PERS_ID
  298. = #{persId},
  299. </if>
  300. <if test="intm != null">INTM
  301. = #{intm},
  302. </if>
  303. <if test="uptm != null">UPTM
  304. = #{uptm},
  305. </if>
  306. <if test="note != null and note != ''">NOTE
  307. = #{note},
  308. </if>
  309. <if test="dataStat != null and dataStat != ''">DATA_STAT
  310. = #{dataStat},
  311. </if>
  312. <if test="state != null and state != ''">STATE
  313. = #{state},
  314. </if>
  315. </trim>
  316. <include refid="page_where"/>
  317. </update>
  318. <!-- 其他自定义SQL -->
  319. </mapper>