AttYndepBaseDao.xml 11 KB

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