InsIncomeMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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="com.ydtech.modules.ins.dao.InsIncomeMapper">
  4. <resultMap id="BaseResultMap" type="com.ydtech.modules.ins.model.InsIncome">
  5. <id column="policyno" jdbcType="VARCHAR" property="policyno"/>
  6. <result column="commission" jdbcType="DOUBLE" property="commission"/>
  7. <result column="finalcommission" jdbcType="DOUBLE" property="finalcommission"/>
  8. <result column="doingcommission" jdbcType="DOUBLE" property="doingcommission"/>
  9. <result column="creattime" jdbcType="TIMESTAMP" property="creattime"/>
  10. <result column="updatedate" jdbcType="TIMESTAMP" property="updatedate"/>
  11. </resultMap>
  12. <sql id="Base_Column_List">
  13. policyno, commission, finalcommission, doingcommission, creattime, updatedate
  14. </sql>
  15. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  16. select
  17. <include refid="Base_Column_List"/>
  18. from ins_income
  19. where policyno = #{policyno,jdbcType=VARCHAR}
  20. </select>
  21. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  22. delete
  23. from ins_income
  24. where policyno = #{policyno,jdbcType=VARCHAR}
  25. </delete>
  26. <insert id="insert" parameterType="com.ydtech.modules.ins.model.InsIncome">
  27. insert into ins_income (policyno, commission, finalcommission,
  28. doingcommission, creattime, updatedate)
  29. values (#{policyno,jdbcType=VARCHAR}, #{commission,jdbcType=DOUBLE}, #{finalcommission,jdbcType=DOUBLE},
  30. #{doingcommission,jdbcType=DOUBLE}, #{creattime,jdbcType=TIMESTAMP}, #{updatedate,jdbcType=TIMESTAMP})
  31. </insert>
  32. <insert id="insertSelective" parameterType="com.ydtech.modules.ins.model.InsIncome">
  33. insert into ins_income
  34. <trim prefix="(" suffix=")" suffixOverrides=",">
  35. <if test="policyno != null">
  36. policyno,
  37. </if>
  38. <if test="commission != null">
  39. commission,
  40. </if>
  41. <if test="finalcommission != null">
  42. finalcommission,
  43. </if>
  44. <if test="doingcommission != null">
  45. doingcommission,
  46. </if>
  47. <if test="creattime != null">
  48. creattime,
  49. </if>
  50. <if test="updatedate != null">
  51. updatedate,
  52. </if>
  53. </trim>
  54. <trim prefix="values (" suffix=")" suffixOverrides=",">
  55. <if test="policyno != null">
  56. #{policyno,jdbcType=VARCHAR},
  57. </if>
  58. <if test="commission != null">
  59. #{commission,jdbcType=DOUBLE},
  60. </if>
  61. <if test="finalcommission != null">
  62. #{finalcommission,jdbcType=DOUBLE},
  63. </if>
  64. <if test="doingcommission != null">
  65. #{doingcommission,jdbcType=DOUBLE},
  66. </if>
  67. <if test="creattime != null">
  68. #{creattime,jdbcType=TIMESTAMP},
  69. </if>
  70. <if test="updatedate != null">
  71. #{updatedate,jdbcType=TIMESTAMP},
  72. </if>
  73. </trim>
  74. </insert>
  75. <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.ins.model.InsIncome">
  76. update ins_income
  77. <set>
  78. <if test="commission != null">
  79. commission = #{commission,jdbcType=DOUBLE},
  80. </if>
  81. <if test="finalcommission != null">
  82. finalcommission = #{finalcommission,jdbcType=DOUBLE},
  83. </if>
  84. <if test="doingcommission != null">
  85. doingcommission = #{doingcommission,jdbcType=DOUBLE},
  86. </if>
  87. <if test="creattime != null">
  88. creattime = #{creattime,jdbcType=TIMESTAMP},
  89. </if>
  90. <if test="updatedate != null">
  91. updatedate = #{updatedate,jdbcType=TIMESTAMP},
  92. </if>
  93. </set>
  94. where policyno = #{policyno,jdbcType=VARCHAR}
  95. </update>
  96. <update id="updateByPrimaryKey" parameterType="com.ydtech.modules.ins.model.InsIncome">
  97. update ins_income
  98. set commission = #{commission,jdbcType=DOUBLE},
  99. finalcommission = #{finalcommission,jdbcType=DOUBLE},
  100. doingcommission = #{doingcommission,jdbcType=DOUBLE},
  101. creattime = #{creattime,jdbcType=TIMESTAMP},
  102. updatedate = #{updatedate,jdbcType=TIMESTAMP}
  103. where policyno = #{policyno,jdbcType=VARCHAR}
  104. </update>
  105. <update id="updateBatch">
  106. <foreach collection="incomeList" separator=";" item="item">
  107. update ins_income set
  108. commission = #{item.commission},
  109. finalcommission = #{item.finalcommission},
  110. doingcommission = #{item.doingcommission},
  111. updatedate = #{item.updatedate}
  112. where policyno = #{item.policyno}
  113. </foreach>
  114. </update>
  115. </mapper>