1bf0c33aafbce34d73036eef464d2c5530ffccc7.svn-base 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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.AttProjectInsuranceRecordDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttProjectInsuranceRecord" id="attProjectInsuranceRecordResultMap">
  5. <result property="state" column="STATE"/>
  6. <result property="year" column="YEAR"/>
  7. <result property="id" column="ID"/>
  8. <result property="projectId" column="PROJECT_ID"/>
  9. <result property="policyholder" column="POLICYHOLDER"/>
  10. <result property="policyholderPhone" column="POLICYHOLDER_PHONE"/>
  11. <result property="insuranceCompany" column="INSURANCE_COMPANY"/>
  12. <result property="insuranceContactPerson" column="INSURANCE_CONTACT_PERSON"/>
  13. <result property="insuranceContactPhone" column="INSURANCE_CONTACT_PHONE"/>
  14. <result property="premiumAmount" column="PREMIUM_AMOUNT"/>
  15. <result property="preventionServiceFee" column="PREVENTION_SERVICE_FEE"/>
  16. <result property="insuranceDate" column="INSURANCE_DATE"/>
  17. <result property="preventionServiceUnit" column="PREVENTION_SERVICE_UNIT"/>
  18. <result property="serviceUnitContactPerson" column="SERVICE_UNIT_CONTACT_PERSON"/>
  19. <result property="serviceUnitContactPhone" column="SERVICE_UNIT_CONTACT_PHONE"/>
  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. YEAR,
  26. STATE,
  27. ID,
  28. PROJECT_ID,
  29. POLICYHOLDER,
  30. POLICYHOLDER_PHONE,
  31. INSURANCE_COMPANY,
  32. INSURANCE_CONTACT_PERSON,
  33. INSURANCE_CONTACT_PHONE,
  34. PREMIUM_AMOUNT,
  35. PREVENTION_SERVICE_FEE,
  36. INSURANCE_DATE,
  37. PREVENTION_SERVICE_UNIT,
  38. SERVICE_UNIT_CONTACT_PERSON,
  39. SERVICE_UNIT_CONTACT_PHONE,
  40. INTM,
  41. UPTM,
  42. DATA_STAT
  43. </sql>
  44. <sql id="entity_properties">
  45. #{year},
  46. #{state},
  47. #{id},
  48. #{projectId},
  49. #{policyholder},
  50. #{policyholderPhone},
  51. #{insuranceCompany},
  52. #{insuranceContactPerson},
  53. #{insuranceContactPhone},
  54. #{premiumAmount},
  55. #{preventionServiceFee},
  56. #{insuranceDate},
  57. #{preventionServiceUnit},
  58. #{serviceUnitContactPerson},
  59. #{serviceUnitContactPhone},
  60. #{intm},
  61. #{uptm},
  62. #{dataStat}
  63. </sql>
  64. <sql id="page_where">
  65. <trim prefix="where" prefixOverrides="and | or ">
  66. <if test="year != null and year != ''">and YEAR = #{year}</if>
  67. <if test="projectId != null and projectId != ''">and PROJECT_ID = #{projectId}</if>
  68. <if test="policyholder != null and policyholder != ''">and POLICYHOLDER = #{policyholder}</if>
  69. <if test="policyholderPhone != null and policyholderPhone != ''">and POLICYHOLDER_PHONE = #{policyholderPhone}</if>
  70. <if test="insuranceCompany != null and insuranceCompany != ''">and INSURANCE_COMPANY like '%${insuranceCompany}%'</if>
  71. <if test="insuranceContactPerson != null and insuranceContactPerson != ''">and INSURANCE_CONTACT_PERSON = #{insuranceContactPerson}</if>
  72. <if test="insuranceContactPhone != null and insuranceContactPhone != ''">and INSURANCE_CONTACT_PHONE = #{insuranceContactPhone}</if>
  73. <if test="premiumAmount != null and premiumAmount != ''">and PREMIUM_AMOUNT = #{premiumAmount}</if>
  74. <if test="preventionServiceFee != null and preventionServiceFee != ''">and PREVENTION_SERVICE_FEE = #{preventionServiceFee}</if>
  75. <if test="insuranceDate != null">and INSURANCE_DATE = #{insuranceDate}</if>
  76. <if test="preventionServiceUnit != null and preventionServiceUnit != ''">and PREVENTION_SERVICE_UNIT = #{preventionServiceUnit}</if>
  77. <if test="serviceUnitContactPerson != null and serviceUnitContactPerson != ''">and SERVICE_UNIT_CONTACT_PERSON = #{serviceUnitContactPerson}</if>
  78. <if test="serviceUnitContactPhone != null and serviceUnitContactPhone != ''">and SERVICE_UNIT_CONTACT_PHONE = #{serviceUnitContactPhone}</if>
  79. <if test="intm != null">and INTM = #{intm}</if>
  80. <if test="uptm != null">and UPTM = #{uptm}</if>
  81. and DATA_STAT='0'
  82. </trim>
  83. </sql>
  84. <select id="get" resultMap="attProjectInsuranceRecordResultMap" parameterType="String" >
  85. select <include refid="table_columns" /> from ATT_PROJECT_INSURANCE_RECORD where ID = #{id}
  86. </select>
  87. <select id="getBy" resultMap="attProjectInsuranceRecordResultMap">
  88. select <include refid="table_columns" /> from ATT_PROJECT_INSURANCE_RECORD <include refid="page_where" />
  89. </select>
  90. <select id="findAll" resultMap="attProjectInsuranceRecordResultMap">
  91. select <include refid="table_columns" /> from ATT_PROJECT_INSURANCE_RECORD
  92. </select>
  93. <select id="findList" resultMap="attProjectInsuranceRecordResultMap">
  94. select <include refid="table_columns" /> from ATT_PROJECT_INSURANCE_RECORD <include refid="page_where" />
  95. ORDER BY INSURANCE_DATE DESC
  96. </select>
  97. <select id="selectCount" resultType="int" >
  98. select count(ID) from ATT_PROJECT_INSURANCE_RECORD <include refid="page_where" />
  99. </select>
  100. <select id="getByNew" resultType="cn.com.goldenwater.dcproj.model.AttProjectInsuranceRecord">
  101. SELECT *
  102. FROM (
  103. SELECT *
  104. FROM ATT_PROJECT_INSURANCE_RECORD
  105. WHERE PROJECT_ID = #{id}
  106. AND DATA_STAT = '0'
  107. ORDER BY INSURANCE_DATE DESC
  108. )
  109. WHERE ROWNUM = 1
  110. </select>
  111. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttProjectInsuranceRecord">
  112. insert into ATT_PROJECT_INSURANCE_RECORD( <include refid="table_columns" /> )
  113. values ( <include refid="entity_properties" /> )
  114. </insert>
  115. <delete id="delete" parameterType="java.lang.String">
  116. update ATT_PROJECT_INSURANCE_RECORD set DATA_STAT='9' where ID = #{id}
  117. </delete>
  118. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttProjectInsuranceRecord">
  119. update ATT_PROJECT_INSURANCE_RECORD set DATA_STAT='9' <include refid="page_where" />
  120. </delete>
  121. <update id="deleteInFlag" parameterType="java.lang.String">
  122. update ATT_PROJECT_INSURANCE_RECORD set DATA_STAT = '9' where ID = #{id}
  123. </update>
  124. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttProjectInsuranceRecord">
  125. update ATT_PROJECT_INSURANCE_RECORD
  126. <trim prefix="set" suffixOverrides=",">
  127. <if test="year != null and year != ''">YEAR = #{year},</if>
  128. <if test="state != null and state != ''">STATE = #{state},</if>
  129. <if test="projectId != null and projectId != ''">PROJECT_ID = #{projectId},</if>
  130. <if test="policyholder != null and policyholder != ''">POLICYHOLDER = #{policyholder},</if>
  131. <if test="policyholderPhone != null and policyholderPhone != ''">POLICYHOLDER_PHONE = #{policyholderPhone},</if>
  132. <if test="insuranceCompany != null and insuranceCompany != ''">INSURANCE_COMPANY = #{insuranceCompany},</if>
  133. <if test="insuranceContactPerson != null and insuranceContactPerson != ''">INSURANCE_CONTACT_PERSON = #{insuranceContactPerson},</if>
  134. <if test="insuranceContactPhone != null and insuranceContactPhone != ''">INSURANCE_CONTACT_PHONE = #{insuranceContactPhone},</if>
  135. <if test="premiumAmount != null and premiumAmount != ''">PREMIUM_AMOUNT = #{premiumAmount},</if>
  136. <if test="preventionServiceFee != null and preventionServiceFee != ''">PREVENTION_SERVICE_FEE = #{preventionServiceFee},</if>
  137. <if test="insuranceDate != null">INSURANCE_DATE = #{insuranceDate},</if>
  138. <if test="preventionServiceUnit != null and preventionServiceUnit != ''">PREVENTION_SERVICE_UNIT = #{preventionServiceUnit},</if>
  139. <if test="serviceUnitContactPerson != null and serviceUnitContactPerson != ''">SERVICE_UNIT_CONTACT_PERSON = #{serviceUnitContactPerson},</if>
  140. <if test="serviceUnitContactPhone != null and serviceUnitContactPhone != ''">SERVICE_UNIT_CONTACT_PHONE = #{serviceUnitContactPhone},</if>
  141. <if test="intm != null">INTM = #{intm},</if>
  142. <if test="uptm != null">UPTM = #{uptm},</if>
  143. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  144. </trim>
  145. <where>ID = #{id}</where>
  146. </update>
  147. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttProjectInsuranceRecord">
  148. update ATT_PROJECT_INSURANCE_RECORD
  149. <trim prefix="set" suffixOverrides=",">
  150. <if test="year != null and year != ''">YEAR = #{year},</if>
  151. <if test="state != null and state != ''">STATE = #{state},</if>
  152. <if test="projectId != null and projectId != ''">PROJECT_ID = #{projectId},</if>
  153. <if test="policyholder != null and policyholder != ''">POLICYHOLDER = #{policyholder},</if>
  154. <if test="policyholderPhone != null and policyholderPhone != ''">POLICYHOLDER_PHONE = #{policyholderPhone},</if>
  155. <if test="insuranceCompany != null and insuranceCompany != ''">INSURANCE_COMPANY = #{insuranceCompany},</if>
  156. <if test="insuranceContactPerson != null and insuranceContactPerson != ''">INSURANCE_CONTACT_PERSON = #{insuranceContactPerson},</if>
  157. <if test="insuranceContactPhone != null and insuranceContactPhone != ''">INSURANCE_CONTACT_PHONE = #{insuranceContactPhone},</if>
  158. <if test="premiumAmount != null and premiumAmount != ''">PREMIUM_AMOUNT = #{premiumAmount},</if>
  159. <if test="preventionServiceFee != null and preventionServiceFee != ''">PREVENTION_SERVICE_FEE = #{preventionServiceFee},</if>
  160. <if test="insuranceDate != null">INSURANCE_DATE = #{insuranceDate},</if>
  161. <if test="preventionServiceUnit != null and preventionServiceUnit != ''">PREVENTION_SERVICE_UNIT = #{preventionServiceUnit},</if>
  162. <if test="serviceUnitContactPerson != null and serviceUnitContactPerson != ''">SERVICE_UNIT_CONTACT_PERSON = #{serviceUnitContactPerson},</if>
  163. <if test="serviceUnitContactPhone != null and serviceUnitContactPhone != ''">SERVICE_UNIT_CONTACT_PHONE = #{serviceUnitContactPhone},</if>
  164. <if test="intm != null">INTM = #{intm},</if>
  165. <if test="uptm != null">UPTM = #{uptm},</if>
  166. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  167. </trim>
  168. <include refid="page_where" />
  169. </update>
  170. <!-- 其他自定义SQL -->
  171. </mapper>