c1650921bdfd5d5793527c9aca3cbae4f2db5259.svn-base 9.3 KB

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