AttDepBaseDao.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.AttDepBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttDepBase" id="attDepBaseResultMap">
  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="wintCode" column="WINT_CODE"/>
  10. <result property="loc" column="LOC"/>
  11. <result property="depPers" column="DEP_PERS"/>
  12. <result property="depPersTel" column="DEP_PERS_TEL"/>
  13. <result property="utLead" column="UT_LEAD"/>
  14. <result property="principalTel" column="PRINCIPAL_TEL"/>
  15. <result property="note" column="NOTE"/>
  16. <result property="centerX" column="CENTER_X"/>
  17. <result property="centerY" column="CENTER_Y"/>
  18. <result property="gdX" column="GD_X"/>
  19. <result property="gdY" column="GD_Y"/>
  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. WINT_CODE,
  30. LOC,
  31. DEP_PERS,
  32. DEP_PERS_TEL,
  33. UT_LEAD,
  34. PRINCIPAL_TEL,
  35. NOTE,
  36. CENTER_X,
  37. CENTER_Y,
  38. GD_X,
  39. GD_Y,
  40. INTM,
  41. UPTM,
  42. DATA_STAT
  43. </sql>
  44. <sql id="entity_properties">
  45. #{id},
  46. #{depName},
  47. #{adCode},
  48. #{adName},
  49. #{wintCode},
  50. #{loc},
  51. #{depPers},
  52. #{depPersTel},
  53. #{utLead},
  54. #{principalTel},
  55. #{note},
  56. #{centerX},
  57. #{centerY},
  58. #{gdX},
  59. #{gdY},
  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 != ''">and DEP_NAME = #{depName}</if>
  68. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  69. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  70. <if test="wintCode != null and wintCode != ''">and WINT_CODE = #{wintCode}</if>
  71. <if test="loc != null and loc != ''">and LOC = #{loc}</if>
  72. <if test="depPers != null and depPers != ''">and DEP_PERS = #{depPers}</if>
  73. <if test="depPersTel != null and depPersTel != ''">and DEP_PERS_TEL = #{depPersTel}</if>
  74. <if test="utLead != null and utLead != ''">and UT_LEAD = #{utLead}</if>
  75. <if test="principalTel != null and principalTel != ''">and PRINCIPAL_TEL = #{principalTel}</if>
  76. <if test="note != null and note != ''">and NOTE = #{note}</if>
  77. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  78. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  79. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  80. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  81. <if test="intm != null">and INTM = #{intm}</if>
  82. <if test="uptm != null">and UPTM = #{uptm}</if>
  83. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  84. and DATA_STAT='0'
  85. </trim>
  86. </sql>
  87. <select id="get" resultMap="attDepBaseResultMap" parameterType="String" >
  88. select <include refid="table_columns" /> from ATT_DEP_BASE where ID = #{id}
  89. </select>
  90. <select id="getBy" resultMap="attDepBaseResultMap">
  91. select <include refid="table_columns" /> from ATT_DEP_BASE <include refid="page_where" />
  92. </select>
  93. <select id="findAll" resultMap="attDepBaseResultMap">
  94. select <include refid="table_columns" /> from ATT_DEP_BASE
  95. </select>
  96. <select id="findList" resultMap="attDepBaseResultMap">
  97. select <include refid="table_columns" /> from ATT_DEP_BASE <include refid="page_where" />
  98. </select>
  99. <select id="selectCount" resultType="int" >
  100. select count(ID) from ATT_DEP_BASE <include refid="page_where" />
  101. </select>
  102. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttDepBase">
  103. insert into ATT_DEP_BASE( <include refid="table_columns" /> )
  104. values ( <include refid="entity_properties" /> )
  105. </insert>
  106. <delete id="delete" parameterType="java.lang.String">
  107. update ATT_DEP_BASE set DATA_STAT='9' where ID = #{id}
  108. </delete>
  109. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttDepBase">
  110. update ATT_DEP_BASE set DATA_STAT='9' <include refid="page_where" />
  111. </delete>
  112. <update id="deleteInFlag" parameterType="java.lang.String">
  113. update ATT_DEP_BASE set DATA_STAT = '9' where ID = #{id}
  114. </update>
  115. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttDepBase">
  116. update ATT_DEP_BASE
  117. <trim prefix="set" suffixOverrides=",">
  118. <if test="depName != null and depName != ''">DEP_NAME = #{depName},</if>
  119. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  120. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  121. <if test="wintCode != null and wintCode != ''">WINT_CODE = #{wintCode},</if>
  122. <if test="loc != null and loc != ''">LOC = #{loc},</if>
  123. <if test="depPers != null and depPers != ''">DEP_PERS = #{depPers},</if>
  124. <if test="depPersTel != null and depPersTel != ''">DEP_PERS_TEL = #{depPersTel},</if>
  125. <if test="utLead != null and utLead != ''">UT_LEAD = #{utLead},</if>
  126. <if test="principalTel != null and principalTel != ''">PRINCIPAL_TEL = #{principalTel},</if>
  127. <if test="note != null and note != ''">NOTE = #{note},</if>
  128. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  129. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  130. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  131. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  132. <if test="intm != null">INTM = #{intm},</if>
  133. <if test="uptm != null">UPTM = #{uptm},</if>
  134. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  135. </trim>
  136. <where>ID = #{id}</where>
  137. </update>
  138. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttDepBase">
  139. update ATT_DEP_BASE
  140. <trim prefix="set" suffixOverrides=",">
  141. <if test="depName != null and depName != ''">DEP_NAME = #{depName},</if>
  142. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  143. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  144. <if test="wintCode != null and wintCode != ''">WINT_CODE = #{wintCode},</if>
  145. <if test="loc != null and loc != ''">LOC = #{loc},</if>
  146. <if test="depPers != null and depPers != ''">DEP_PERS = #{depPers},</if>
  147. <if test="depPersTel != null and depPersTel != ''">DEP_PERS_TEL = #{depPersTel},</if>
  148. <if test="utLead != null and utLead != ''">UT_LEAD = #{utLead},</if>
  149. <if test="principalTel != null and principalTel != ''">PRINCIPAL_TEL = #{principalTel},</if>
  150. <if test="note != null and note != ''">NOTE = #{note},</if>
  151. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  152. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  153. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  154. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  155. <if test="intm != null">INTM = #{intm},</if>
  156. <if test="uptm != null">UPTM = #{uptm},</if>
  157. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  158. </trim>
  159. <include refid="page_where" />
  160. </update>
  161. <!-- 其他自定义SQL -->
  162. <select id="getObjId" resultType="cn.com.goldenwater.dcproj.model.AttDepBase">
  163. SELECT
  164. <include refid="table_columns" />
  165. FROM ATT_DEP_BASE
  166. WHERE ID = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  167. </select>
  168. </mapper>