ef7e705707e50de39bae71d7dc320f16c525ce79.svn-base 9.7 KB

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