AttWtuntBaseDao.xml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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.AttWtuntBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttWtuntBase" id="attWtuntBaseResultMap">
  5. <result property="id" column="ID" />
  6. <result property="utName" column="UT_NAME" />
  7. <result property="utCode" column="UT_CODE" />
  8. <result property="adName" column="AD_NAME" />
  9. <result property="adCode" column="AD_CODE" />
  10. <result property="utType" column="UT_TYPE" />
  11. <result property="utPpt" column="UT_PPT" />
  12. <result property="utLead" column="UT_LEAD" />
  13. <result property="utAttn" column="UT_ATTN" />
  14. <result property="utCont" column="UT_CONT" />
  15. <result property="appDepTm" column="APP_DEP_TM" />
  16. <result property="appDep" column="APP_DEP" />
  17. <result property="principalTel" column="PRINCIPAL_TEL" />
  18. <result property="note" column="NOTE" />
  19. <result property="signAddr" column="SIGN_ADDR" />
  20. <result property="utAddr" column="UT_ADDR" />
  21. <result property="centerX" column="CENTER_X" />
  22. <result property="centerY" column="CENTER_Y" />
  23. <result property="gdX" column="GD_X" />
  24. <result property="gdY" column="GD_Y" />
  25. <result property="intm" column="INTM" />
  26. <result property="uptm" column="UPTM" />
  27. <result property="intakeNo" column="INTAKE_NO" />
  28. <result property="intakeAmt" column="INTAKE_AMT" />
  29. </resultMap>
  30. <sql id="table_columns">
  31. ID,
  32. UT_NAME,
  33. INTAKE_NO,
  34. INTAKE_AMT,
  35. UT_CODE,
  36. AD_NAME,
  37. AD_CODE,
  38. UT_TYPE,
  39. UT_PPT,
  40. UT_LEAD,
  41. UT_ATTN,
  42. UT_CONT,
  43. APP_DEP_TM,
  44. APP_DEP,
  45. PRINCIPAL_TEL,
  46. NOTE,
  47. SIGN_ADDR,
  48. UT_ADDR,
  49. CENTER_X,
  50. CENTER_Y,
  51. GD_X,
  52. GD_Y,
  53. INTM,
  54. UPTM
  55. </sql>
  56. <sql id="entity_properties">
  57. #{id},
  58. #{utName},
  59. #{intakeNo},
  60. #{intakeAmt},
  61. #{utCode},
  62. #{adName},
  63. #{adCode},
  64. #{utType},
  65. #{utPpt},
  66. #{utLead},
  67. #{utAttn},
  68. #{utCont},
  69. #{appDepTm},
  70. #{appDep},
  71. #{principalTel},
  72. #{note},
  73. #{signAddr},
  74. #{utAddr},
  75. #{centerX},
  76. #{centerY},
  77. #{gdX},
  78. #{gdY},
  79. #{intm},
  80. #{uptm}
  81. </sql>
  82. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  83. <sql id="page_where">
  84. <trim prefix="where" prefixOverrides="and | or ">
  85. <if test="utName != null and utName != ''">and UT_NAME = #{utName}</if>
  86. <if test="intakeNo != null and intakeNo != ''">and INTAKE_NO = #{intakeNo}</if>
  87. <if test="intakeAmt != null and intakeAmt != ''">and INTAKE_AMT = #{intakeAmt}</if>
  88. <if test="utCode != null and utCode != ''">and UT_CODE = #{utCode}</if>
  89. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  90. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  91. <if test="utType != null and utType != ''">and UT_TYPE = #{utType}</if>
  92. <if test="utPpt != null and utPpt != ''">and UT_PPT = #{utPpt}</if>
  93. <if test="utLead != null and utLead != ''">and UT_LEAD = #{utLead}</if>
  94. <if test="utAttn != null and utAttn != ''">and UT_ATTN = #{utAttn}</if>
  95. <if test="utCont != null and utCont != ''">and UT_CONT = #{utCont}</if>
  96. <if test="appDepTm != null and appDepTm != ''">and APP_DEP_TM = #{appDepTm}</if>
  97. <if test="appDep != null and appDep != ''">and APP_DEP = #{appDep}</if>
  98. <if test="principalTel != null and principalTel != ''">and PRINCIPAL_TEL = #{principalTel}</if>
  99. <if test="note != null and note != ''">and NOTE = #{note}</if>
  100. <if test="signAddr != null and signAddr != ''">and SIGN_ADDR = #{signAddr}</if>
  101. <if test="utAddr != null and utAddr != ''">and UT_ADDR = #{utAddr}</if>
  102. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  103. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  104. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  105. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  106. <if test="intm != null">and INTM = #{intm}</if>
  107. <if test="uptm != null">and UPTM = #{uptm}</if>
  108. </trim>
  109. </sql>
  110. <select id="get" resultMap="attWtuntBaseResultMap" parameterType="String" >
  111. select <include refid="table_columns" /> from ATT_WTUNT_BASE where ID = #{id}
  112. </select>
  113. <select id="getBy" resultMap="attWtuntBaseResultMap">
  114. select <include refid="table_columns" /> from ATT_WTUNT_BASE <include refid="page_where" />
  115. </select>
  116. <select id="findAll" resultMap="attWtuntBaseResultMap">
  117. select <include refid="table_columns" /> from ATT_WTUNT_BASE
  118. </select>
  119. <select id="findList" resultMap="attWtuntBaseResultMap">
  120. select <include refid="table_columns" /> from ATT_WTUNT_BASE <include refid="page_where" />
  121. </select>
  122. <select id="selectCount" resultType="int" >
  123. select count(ID) from ATT_WTUNT_BASE <include refid="page_where" />
  124. </select>
  125. <select id="getObjId" resultType="cn.com.goldenwater.dcproj.model.AttWtuntBase">
  126. SELECT
  127. <include refid="table_columns" />
  128. FROM ATT_WTUNT_BASE
  129. WHERE ID = (SELECT CODE FROM BIS_INSP_ALL_OBJ WHERE OBJ_ID = #{objId})
  130. </select>
  131. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttWtuntBase">
  132. insert into ATT_WTUNT_BASE( <include refid="table_columns" /> )
  133. values ( <include refid="entity_properties" /> )
  134. </insert>
  135. <delete id="delete" parameterType="java.lang.String">
  136. delete from ATT_WTUNT_BASE where ID = #{id}
  137. </delete>
  138. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttWtuntBase">
  139. delete from ATT_WTUNT_BASE <include refid="page_where" />
  140. </delete>
  141. <update id="deleteInFlag" parameterType="java.lang.String">
  142. update ATT_WTUNT_BASE set flag_valid = 0 where>ID = #{id}
  143. </update>
  144. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttWtuntBase">
  145. update ATT_WTUNT_BASE
  146. <trim prefix="set" suffixOverrides=",">
  147. <if test="intakeNo != null and intakeNo != ''">INTAKE_NO = #{intakeNo},</if>
  148. <if test="intakeAmt != null and intakeAmt != ''">INTAKE_AMT = #{intakeAmt},</if>
  149. <if test="utName != null and utName != ''">UT_NAME = #{utName},</if>
  150. <if test="utCode != null and utCode != ''">UT_CODE = #{utCode},</if>
  151. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  152. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  153. <if test="utType != null and utType != ''">UT_TYPE = #{utType},</if>
  154. <if test="utPpt != null and utPpt != ''">UT_PPT = #{utPpt},</if>
  155. <if test="utLead != null and utLead != ''">UT_LEAD = #{utLead},</if>
  156. <if test="utAttn != null and utAttn != ''">UT_ATTN = #{utAttn},</if>
  157. <if test="utCont != null and utCont != ''">UT_CONT = #{utCont},</if>
  158. <if test="appDepTm != null and appDepTm != ''">APP_DEP_TM = #{appDepTm},</if>
  159. <if test="appDep != null and appDep != ''">APP_DEP = #{appDep},</if>
  160. <if test="principalTel != null and principalTel != ''">PRINCIPAL_TEL = #{principalTel},</if>
  161. <if test="note != null and note != ''">NOTE = #{note},</if>
  162. <if test="signAddr != null and signAddr != ''">SIGN_ADDR = #{signAddr},</if>
  163. <if test="utAddr != null and utAddr != ''">UT_ADDR = #{utAddr},</if>
  164. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  165. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  166. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  167. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  168. <if test="intm != null">INTM = #{intm},</if>
  169. <if test="uptm != null">UPTM = #{uptm},</if>
  170. </trim>
  171. <where>ID = #{id}</where>
  172. </update>
  173. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttWtuntBase">
  174. update ATT_WTUNT_BASE
  175. <trim prefix="set" suffixOverrides=",">
  176. <if test="intakeNo != null and intakeNo != ''">INTAKE_NO = #{intakeNo},</if>
  177. <if test="intakeAmt != null and intakeAmt != ''">INTAKE_AMT = #{intakeAmt},</if>
  178. <if test="utName != null and utName != ''">UT_NAME = #{utName},</if>
  179. <if test="utCode != null and utCode != ''">UT_CODE = #{utCode},</if>
  180. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  181. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  182. <if test="utType != null and utType != ''">UT_TYPE = #{utType},</if>
  183. <if test="utPpt != null and utPpt != ''">UT_PPT = #{utPpt},</if>
  184. <if test="utLead != null and utLead != ''">UT_LEAD = #{utLead},</if>
  185. <if test="utAttn != null and utAttn != ''">UT_ATTN = #{utAttn},</if>
  186. <if test="utCont != null and utCont != ''">UT_CONT = #{utCont},</if>
  187. <if test="appDepTm != null and appDepTm != ''">APP_DEP_TM = #{appDepTm},</if>
  188. <if test="appDep != null and appDep != ''">APP_DEP = #{appDep},</if>
  189. <if test="principalTel != null and principalTel != ''">PRINCIPAL_TEL = #{principalTel},</if>
  190. <if test="note != null and note != ''">NOTE = #{note},</if>
  191. <if test="signAddr != null and signAddr != ''">SIGN_ADDR = #{signAddr},</if>
  192. <if test="utAddr != null and utAddr != ''">UT_ADDR = #{utAddr},</if>
  193. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  194. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  195. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  196. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  197. <if test="intm != null">INTM = #{intm},</if>
  198. <if test="uptm != null">UPTM = #{uptm},</if>
  199. </trim>
  200. <include refid="page_where" />
  201. </update>
  202. <!-- 其他自定义SQL -->
  203. </mapper>