AttProjectInsuranceDao.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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.AttProjectInsuranceDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttProjectInsurance" id="attProjectInsuranceResultMap">
  5. <result property="businessType" column="BUSINESS_TYPE"/>
  6. <result property="adName" column="AD_NAME"/>
  7. <result property="adCode" column="AD_CODE"/>
  8. <result property="id" column="ID"/>
  9. <result property="name" column="NAME"/>
  10. <result property="type" column="TYPE"/>
  11. <result property="loc" column="LOC"/>
  12. <result property="investment" column="INVESTMENT"/>
  13. <result property="plannedDuration" column="PLANNED_DURATION"/>
  14. <result property="startDate" column="START_DATE"/>
  15. <result property="status" column="STATUS"/>
  16. <result property="managementUnit" column="MANAGEMENT_UNIT"/>
  17. <result property="constructors" column="CONSTRUCTORS"/>
  18. <result property="contactPerson" column="CONTACT_PERSON"/>
  19. <result property="centerX" column="CENTER_X"/>
  20. <result property="centerY" column="CENTER_Y"/>
  21. <result property="gdX" column="GD_X"/>
  22. <result property="gdY" column="GD_Y"/>
  23. <result property="intm" column="INTM"/>
  24. <result property="uptm" column="UPTM"/>
  25. <result property="dataStat" column="DATA_STAT"/>
  26. </resultMap>
  27. <sql id="table_columns">
  28. BUSINESS_TYPE
  29. ,
  30. AD_NAME,
  31. AD_CODE,
  32. ID,
  33. NAME,
  34. TYPE,
  35. LOC,
  36. INVESTMENT,
  37. PLANNED_DURATION,
  38. START_DATE,
  39. STATUS,
  40. MANAGEMENT_UNIT,
  41. CONSTRUCTORS,
  42. CONTACT_PERSON,
  43. CENTER_X,
  44. CENTER_Y,
  45. GD_X,
  46. GD_Y,
  47. INTM,
  48. UPTM,
  49. DATA_STAT
  50. </sql>
  51. <sql id="entity_properties">
  52. #{businessType},
  53. #{adName},
  54. #{adCode},
  55. #{id},
  56. #{name},
  57. #{type},
  58. #{loc},
  59. #{investment},
  60. #{plannedDuration},
  61. #{startDate},
  62. #{status},
  63. #{managementUnit},
  64. #{constructors},
  65. #{contactPerson},
  66. #{centerX},
  67. #{centerY},
  68. #{gdX},
  69. #{gdY},
  70. #{intm},
  71. #{uptm},
  72. #{dataStat}
  73. </sql>
  74. <sql id="page_where">
  75. <trim prefix="where" prefixOverrides="and | or ">
  76. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  77. <if test="businessType != null and businessType != ''">and BUSINESS_TYPE = #{businessType}</if>
  78. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  79. <if test="id != null and id != ''">and ID = #{id}</if>
  80. <if test="name != null and name != ''">and NAME like '%${name}%'</if>
  81. <if test="type != null and type != ''">and TYPE = #{type}</if>
  82. <if test="loc != null and loc != ''">and LOC = #{loc}</if>
  83. <if test="investment != null and investment != ''">and INVESTMENT = #{investment}</if>
  84. <if test="plannedDuration != null and plannedDuration != ''">and PLANNED_DURATION = #{plannedDuration}</if>
  85. <if test="startDate != null">and START_DATE = #{startDate}</if>
  86. <if test="status != null and status != ''">and STATUS = #{status}</if>
  87. <if test="managementUnit != null and managementUnit != ''">and MANAGEMENT_UNIT = #{managementUnit}</if>
  88. <if test="constructors != null and constructors != ''">and CONSTRUCTORS = #{constructors}</if>
  89. <if test="contactPerson != null and contactPerson != ''">and CONTACT_PERSON = #{contactPerson}</if>
  90. <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
  91. <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
  92. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  93. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  94. <if test="intm != null">and INTM = #{intm}</if>
  95. <if test="uptm != null">and UPTM = #{uptm}</if>
  96. and DATA_STAT='0'
  97. </trim>
  98. </sql>
  99. <select id="get" resultMap="attProjectInsuranceResultMap" parameterType="String">
  100. select
  101. <include refid="table_columns"/>
  102. from ATT_PROJECT_INSURANCE where ID = #{id}
  103. </select>
  104. <select id="getBy" resultMap="attProjectInsuranceResultMap">
  105. select
  106. <include refid="table_columns"/>
  107. from ATT_PROJECT_INSURANCE
  108. <include refid="page_where"/>
  109. </select>
  110. <select id="findAll" resultMap="attProjectInsuranceResultMap">
  111. select
  112. <include refid="table_columns"/>
  113. from ATT_PROJECT_INSURANCE
  114. </select>
  115. <select id="findList" resultMap="attProjectInsuranceResultMap">
  116. select
  117. <include refid="table_columns"/>
  118. from ATT_PROJECT_INSURANCE
  119. <include refid="page_where"/>
  120. </select>
  121. <select id="selectCount" resultType="int">
  122. select count(ID) from ATT_PROJECT_INSURANCE
  123. <include refid="page_where"/>
  124. </select>
  125. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttProjectInsurance">
  126. insert into ATT_PROJECT_INSURANCE(
  127. <include refid="table_columns"/>
  128. )
  129. values (
  130. <include refid="entity_properties"/>
  131. )
  132. </insert>
  133. <delete id="delete" parameterType="java.lang.String">
  134. update ATT_PROJECT_INSURANCE
  135. set DATA_STAT='9'
  136. where ID = #{id}
  137. </delete>
  138. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttProjectInsurance">
  139. update ATT_PROJECT_INSURANCE set DATA_STAT='9'
  140. <include refid="page_where"/>
  141. </delete>
  142. <update id="deleteInFlag" parameterType="java.lang.String">
  143. update ATT_PROJECT_INSURANCE
  144. set DATA_STAT = '9'
  145. where ID = #{id}
  146. </update>
  147. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttProjectInsurance">
  148. update ATT_PROJECT_INSURANCE
  149. <trim prefix="set" suffixOverrides=",">
  150. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  151. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  152. <if test="id != null and id != ''">ID = #{id},</if>
  153. <if test="name != null and name != ''">NAME = #{name},</if>
  154. <if test="type != null and type != ''">TYPE = #{type},</if>
  155. <if test="loc != null and loc != ''">LOC = #{loc},</if>
  156. <if test="investment != null and investment != ''">INVESTMENT = #{investment},</if>
  157. <if test="plannedDuration != null and plannedDuration != ''">PLANNED_DURATION = #{plannedDuration},</if>
  158. <if test="startDate != null">START_DATE = #{startDate},</if>
  159. <if test="status != null and status != ''">STATUS = #{status},</if>
  160. <if test="managementUnit != null and managementUnit != ''">MANAGEMENT_UNIT = #{managementUnit},</if>
  161. <if test="constructors != null and constructors != ''">CONSTRUCTORS = #{constructors},</if>
  162. <if test="contactPerson != null and contactPerson != ''">CONTACT_PERSON = #{contactPerson},</if>
  163. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  164. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  165. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  166. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  167. <if test="intm != null">INTM = #{intm},</if>
  168. <if test="uptm != null">UPTM = #{uptm},</if>
  169. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  170. </trim>
  171. <where>ID = #{id}</where>
  172. </update>
  173. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttProjectInsurance">
  174. update ATT_PROJECT_INSURANCE
  175. <trim prefix="set" suffixOverrides=",">
  176. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  177. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  178. <if test="id != null and id != ''">ID = #{id},</if>
  179. <if test="name != null and name != ''">NAME = #{name},</if>
  180. <if test="type != null and type != ''">TYPE = #{type},</if>
  181. <if test="loc != null and loc != ''">LOC = #{loc},</if>
  182. <if test="investment != null and investment != ''">INVESTMENT = #{investment},</if>
  183. <if test="plannedDuration != null and plannedDuration != ''">PLANNED_DURATION = #{plannedDuration},</if>
  184. <if test="startDate != null">START_DATE = #{startDate},</if>
  185. <if test="status != null and status != ''">STATUS = #{status},</if>
  186. <if test="managementUnit != null and managementUnit != ''">MANAGEMENT_UNIT = #{managementUnit},</if>
  187. <if test="constructors != null and constructors != ''">CONSTRUCTORS = #{constructors},</if>
  188. <if test="contactPerson != null and contactPerson != ''">CONTACT_PERSON = #{contactPerson},</if>
  189. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  190. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  191. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  192. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  193. <if test="intm != null">INTM = #{intm},</if>
  194. <if test="uptm != null">UPTM = #{uptm},</if>
  195. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  196. </trim>
  197. <include refid="page_where"/>
  198. </update>
  199. <!-- 其他自定义SQL -->
  200. <select id="getByRgstrId" resultMap="attProjectInsuranceResultMap">
  201. SELECT A.*
  202. FROM ATT_PROJECT_INSURANCE A
  203. JOIN BIS_INSP_ALL_OBJ B ON A.ID = B.CODE
  204. JOIN BIS_INSP_ANZE_RGSTR ON B.OBJ_ID = C.OBJ_ID
  205. where C.ID = #{id}
  206. </select>
  207. <select id="listOfUnderwriting" resultType="cn.com.goldenwater.dcproj.dto.AttAnzeUnderwritingDto">
  208. SELECT
  209. A.ID, A.AD_CODE, A.AD_NAME, A.NAME, A.TYPE, A.LOC, A.INVESTMENT,
  210. A.PLANNED_DURATION, A.START_DATE, A.STATUS, A.MANAGEMENT_UNIT,
  211. A.CONTACT_PERSON, A.CENTER_X, A.CENTER_Y, A.GD_X, A.GD_Y,
  212. B.ID AS recordId, B.POLICYHOLDER, B.POLICYHOLDER_PHONE, B.INSURANCE_COMPANY,
  213. B.INSURANCE_CONTACT_PERSON, B.INSURANCE_CONTACT_PHONE, B.PREMIUM_AMOUNT, B.PREVENTION_SERVICE_FEE,
  214. B.INSURANCE_DATE, B.PREVENTION_SERVICE_UNIT, B.SERVICE_UNIT_CONTACT_PERSON,
  215. B.SERVICE_UNIT_CONTACT_PHONE, B.INTM, B.UPTM, B.YEAR
  216. FROM ATT_PROJECT_INSURANCE A
  217. JOIN ATT_PROJECT_INSURANCE_RECORD B ON A.ID = B.PROJECT_ID
  218. WHERE B.YEAR = #{year}
  219. AND A.BUSINESS_TYPE = '1'
  220. <if test="id != null and id != ''">and A.ID = #{id}</if>
  221. <if test="adCode != null and adCode != ''">and A.AD_CODE like '${adCode}%'</if>
  222. <if test="adName != null and adName != ''">and A.AD_NAME like '%${adName}%'</if>
  223. <if test="name != null and name != ''">and A.NAME like '%${name}%'</if>
  224. <if test="type != null and type != ''">and A.TYPE = #{type}</if>
  225. <if test="insuranceCompany != null and insuranceCompany != ''">and B.INSURANCE_COMPANY like '%${insuranceCompany}%'</if>
  226. <if test="investment != null and investment != ''">and A.INVESTMENT = #{investment}</if>
  227. <if test="plannedDuration != null and plannedDuration != ''">and A.PLANNED_DURATION = #{plannedDuration}</if>
  228. <if test="startDate != null">and A.START_DATE = #{startDate}</if>
  229. <if test="state != null and state != ''">and B.STATE = #{state}</if>
  230. <if test="managementUnit != null and managementUnit != ''">and A.MANAGEMENT_UNIT = #{managementUnit}</if>
  231. <if test="contactPerson != null and contactPerson != ''">and A.CONTACT_PERSON = #{contactPerson}</if>
  232. and A.DATA_STAT='0'
  233. and B.DATA_STAT='0'
  234. </select>
  235. </mapper>