| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ydtech.modules.ins.dao.InsPmainMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.ins.model.InsPmain">
- <id column="endorseno" jdbcType="VARCHAR" property="endorseno"/>
- <result column="policyno" jdbcType="VARCHAR" property="policyno"/>
- <result column="chgpremium" jdbcType="DOUBLE" property="chgpremium"/>
- <result column="chgamount" jdbcType="DOUBLE" property="chgamount"/>
- <result column="sumpremium" jdbcType="DOUBLE" property="sumpremium"/>
- <result column="sumamount" jdbcType="DOUBLE" property="sumamount"/>
- <result column="commissionrate" jdbcType="DOUBLE" property="commissionrate"/>
- <result column="startdate" jdbcType="TIMESTAMP" property="startdate"/>
- <result column="enddate" jdbcType="TIMESTAMP" property="enddate"/>
- <result column="operatedate" jdbcType="TIMESTAMP" property="operatedate"/>
- <result column="updatedate" jdbcType="TIMESTAMP" property="updatedate"/>
- <result column="notaxpremium" jdbcType="DOUBLE" property="notaxpremium"/>
- <result column="paydate" jdbcType="TIMESTAMP" property="paydate"/>
- </resultMap>
- <sql id="Base_Column_List">
- endorseno, policyno, chgpremium, chgamount, sumpremium,
- sumamount, commissionrate, startdate, enddate, operatedate,
- updatedate, notaxpremium, paydate
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from ins_pmain
- where endorseno = #{endorseno,jdbcType=VARCHAR}
- </select>
- <select id="selectByVo" resultType="com.ydtech.modules.ins.model.vo.res.InsPmainResVo">
- select
- a.endorseno,
- a.policyno,
- a.chgpremium chgpremium,
- a.chgamount,
- a.sumpremium,
- a.sumamount,
- CASE
- WHEN a.commissionrate IS NULL THEN
- b.commissionrate ELSE a.commissionrate
- END as commissionrate,
- a.startdate,
- a.enddate,
- a.operatedate,
- a.updatedate,
- a.notaxpremium,
- b.inscompany,
- b.comcode,
- (select name from esm_ins_company where id=b.inscompany) inscompanyname,
- (select name from sys_dept where id=comcode) comname,
- b.carflag,
- a.paydate paydate
- from ins_pmain a left join ins_cmain b on a.policyno=b.policyno
- where 1=1
- <if test="endorseno != null and endorseno !='' ">
- and a.endorseno = #{endorseno,jdbcType=VARCHAR}
- </if>
- <if test="policyno != null and policyno !='' ">
- and a.policyno = #{policyno,jdbcType=VARCHAR}
- </if>
- <if test="comcode != null and comcode !='' ">
- and b.comcode like concat( #{comcode,jdbcType=VARCHAR} , '%')
- </if>
- <if test="inscompany != null and inscompany !='' ">
- and b.inscompany = #{inscompany,jdbcType=VARCHAR}
- </if>
- order by a.endorseno
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete
- from ins_pmain
- where endorseno = #{endorseno,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.ydtech.modules.ins.model.InsPmain">
- insert into ins_pmain (endorseno, policyno, chgpremium,
- chgamount, sumpremium, sumamount,
- commissionrate, startdate, enddate,
- operatedate, updatedate, notaxpremium,
- paydate)
- values (#{endorseno,jdbcType=VARCHAR}, #{policyno,jdbcType=VARCHAR}, #{chgpremium,jdbcType=DOUBLE},
- #{chgamount,jdbcType=DOUBLE}, #{sumpremium,jdbcType=DOUBLE}, #{sumamount,jdbcType=DOUBLE},
- #{commissionrate,jdbcType=DOUBLE}, #{startdate,jdbcType=TIMESTAMP}, #{enddate,jdbcType=TIMESTAMP},
- #{operatedate,jdbcType=TIMESTAMP}, #{updatedate,jdbcType=TIMESTAMP}, #{notaxpremium,jdbcType=DOUBLE},
- #{paydate,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.ydtech.modules.ins.model.InsPmain">
- insert into ins_pmain
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="endorseno != null">
- endorseno,
- </if>
- <if test="policyno != null">
- policyno,
- </if>
- <if test="chgpremium != null">
- chgpremium,
- </if>
- <if test="chgamount != null">
- chgamount,
- </if>
- <if test="sumpremium != null">
- sumpremium,
- </if>
- <if test="sumamount != null">
- sumamount,
- </if>
- <if test="commissionrate != null">
- commissionrate,
- </if>
- <if test="startdate != null">
- startdate,
- </if>
- <if test="enddate != null">
- enddate,
- </if>
- <if test="operatedate != null">
- operatedate,
- </if>
- <if test="updatedate != null">
- updatedate,
- </if>
- <if test="notaxpremium != null">
- notaxpremium,
- </if>
- <if test="paydate != null">
- paydate,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="endorseno != null">
- #{endorseno,jdbcType=VARCHAR},
- </if>
- <if test="policyno != null">
- #{policyno,jdbcType=VARCHAR},
- </if>
- <if test="chgpremium != null">
- #{chgpremium,jdbcType=DOUBLE},
- </if>
- <if test="chgamount != null">
- #{chgamount,jdbcType=DOUBLE},
- </if>
- <if test="sumpremium != null">
- #{sumpremium,jdbcType=DOUBLE},
- </if>
- <if test="sumamount != null">
- #{sumamount,jdbcType=DOUBLE},
- </if>
- <if test="commissionrate != null">
- #{commissionrate,jdbcType=DOUBLE},
- </if>
- <if test="startdate != null">
- #{startdate,jdbcType=TIMESTAMP},
- </if>
- <if test="enddate != null">
- #{enddate,jdbcType=TIMESTAMP},
- </if>
- <if test="operatedate != null">
- #{operatedate,jdbcType=TIMESTAMP},
- </if>
- <if test="updatedate != null">
- #{updatedate,jdbcType=TIMESTAMP},
- </if>
- <if test="notaxpremium != null">
- #{notaxpremium,jdbcType=DOUBLE},
- </if>
- <if test="paydate != null">
- #{paydate,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <insert id="insertBatch" parameterType="list">
- insert into ins_pmain (
- <include refid="Base_Column_List"/>
- )
- values
- <foreach collection="qtList" item="item" separator=",">
- (#{item.endorseno}, #{item.policyno}, #{item.chgpremium}, #{item.chgamount}, #{item.sumpremium},
- #{item.sumamount}, #{item.commissionrate}, #{item.startdate}, #{item.enddate}, #{item.operatedate},
- #{item.updatedate}, #{item.notaxpremium}, #{item.paydate})
- </foreach>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.ins.model.InsPmain">
- update ins_pmain
- <set>
- <if test="policyno != null">
- policyno = #{policyno,jdbcType=VARCHAR},
- </if>
- <if test="chgpremium != null">
- chgpremium = #{chgpremium,jdbcType=DOUBLE},
- </if>
- <if test="chgamount != null">
- chgamount = #{chgamount,jdbcType=DOUBLE},
- </if>
- <if test="sumpremium != null">
- sumpremium = #{sumpremium,jdbcType=DOUBLE},
- </if>
- <if test="sumamount != null">
- sumamount = #{sumamount,jdbcType=DOUBLE},
- </if>
- <if test="commissionrate != null">
- commissionrate = #{commissionrate,jdbcType=DOUBLE},
- </if>
- <if test="startdate != null">
- startdate = #{startdate,jdbcType=TIMESTAMP},
- </if>
- <if test="enddate != null">
- enddate = #{enddate,jdbcType=TIMESTAMP},
- </if>
- <if test="operatedate != null">
- operatedate = #{operatedate,jdbcType=TIMESTAMP},
- </if>
- <if test="updatedate != null">
- updatedate = #{updatedate,jdbcType=TIMESTAMP},
- </if>
- <if test="notaxpremium != null">
- notaxpremium = #{notaxpremium,jdbcType=DOUBLE},
- </if>
- <if test="paydate != null">
- paydate = #{paydate,jdbcType=TIMESTAMP},
- </if>
- </set>
- where endorseno = #{endorseno,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.ydtech.modules.ins.model.InsPmain">
- update ins_pmain
- set policyno = #{policyno,jdbcType=VARCHAR},
- chgpremium = #{chgpremium,jdbcType=DOUBLE},
- chgamount = #{chgamount,jdbcType=DOUBLE},
- sumpremium = #{sumpremium,jdbcType=DOUBLE},
- sumamount = #{sumamount,jdbcType=DOUBLE},
- commissionrate = #{commissionrate,jdbcType=DOUBLE},
- startdate = #{startdate,jdbcType=TIMESTAMP},
- enddate = #{enddate,jdbcType=TIMESTAMP},
- operatedate = #{operatedate,jdbcType=TIMESTAMP},
- updatedate = #{updatedate,jdbcType=TIMESTAMP},
- notaxpremium = #{notaxpremium,jdbcType=DOUBLE},
- paydate = #{paydate,jdbcType=TIMESTAMP}
- where endorseno = #{endorseno,jdbcType=VARCHAR}
- </update>
- <delete id="deleteBatch">
- DELETE FROM ins_pmain
- WHERE (endorseno, policyno, updatedate) in
- <foreach collection="plist" item="item" index="index" separator="," open="(" close=")">
- (#{item.endorseno, jdbcType=VARCHAR}, #{item.policyno, jdbcType=VARCHAR},
- DATE_FORMAT(#{item.updatedate, jdbcType=TIMESTAMP}, '%Y-%m-%d'))
- </foreach>
- </delete>
- </mapper>
|