| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416 |
- <?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.InsSettleMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.ins.model.InsSettle">
- <id column="settleno" jdbcType="VARCHAR" property="settleno"/>
- <result column="billfee" jdbcType="DECIMAL" property="billfee"/>
- <result column="insurercode" jdbcType="VARCHAR" property="insurercode"/>
- <result column="createdate" jdbcType="TIMESTAMP" property="createdate"/>
- <result column="createcode" jdbcType="VARCHAR" property="createcode"/>
- <result column="confirmdate" jdbcType="TIMESTAMP" property="confirmdate"/>
- <result column="confirmcode" jdbcType="VARCHAR" property="confirmcode"/>
- <result column="checkno" jdbcType="VARCHAR" property="checkno"/>
- <result column="status" jdbcType="VARCHAR" property="status"/>
- <result column="account" jdbcType="VARCHAR" property="account"/>
- <result column="orig_commno" jdbcType="VARCHAR" property="origCommno"/>
- <result column="updatedate" jdbcType="TIMESTAMP" property="updatedate"/>
- <result column="checkflag" jdbcType="CHAR" property="checkflag"/>
- <result column="comcode" jdbcType="VARCHAR" property="comcode"/>
- <result column="fileid" jdbcType="VARCHAR" property="fileid"/>
- <result column="url" jdbcType="VARCHAR" property="url"/>
- <result column="agentcode" jdbcType="VARCHAR" property="agentcode"/>
- <result column="oppbank" jdbcType="VARCHAR" property="oppbank"/>
- <result column="oppbankname" jdbcType="VARCHAR" property="oppbankname"/>
- <result column="oppact" jdbcType="VARCHAR" property="oppact"/>
- <result column="oppactname" jdbcType="VARCHAR" property="oppactname"/>
- </resultMap>
- <sql id="Base_Column_List">
- settleno, billfee, insurercode, createdate, createcode, confirmdate, confirmcode,
- checkno, status, account, orig_commno, updatedate, checkflag, comcode ,fileid, url,agentcode,
- oppbank, oppbankname, oppact, oppactname
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from ins_settle
- where settleno = #{settleno,jdbcType=VARCHAR}
- </select>
- <select id="selectSettle" parameterType="com.ydtech.modules.ins.model.vo.InsSettleReqVo"
- resultType="com.ydtech.modules.ins.model.vo.res.InsSettleResVo">
- select
- settleno,
- billfee,
- insurercode,
- (select name from esm_ins_company where id=insurercode) insurername,
- comcode,
- (select name from sys_dept where id=comcode) comname,
- createdate,
- createcode,
- confirmdate,
- confirmcode,
- checkno,
- status,
- (select name from sys_account where id=account) account,
- orig_commno origCommno,
- updatedate,
- checkflag,
- url,
- agentcode,
- oppbank,
- oppbankname,
- oppact,
- oppactname,
- fileid,
- (SELECT a.oldfilename FROM ins_file a where a.fileid=b.fileid) oldname
- from ins_settle b
- where 1=1
- <if test="settleno != null and settleno != ''">
- AND settleno = #{settleno,jdbcType=VARCHAR}
- </if>
- <if test="insurercode != null and insurercode != ''">
- AND insurercode = #{insurercode,jdbcType=VARCHAR}
- </if>
- <if test="createdatestart != null and createdateend != null">
- AND DATE_FORMAT(createdate, '%Y-%m-%d') between DATE_FORMAT(#{createdatestart,jdbcType=TIMESTAMP},
- '%Y-%m-%d') and DATE_FORMAT(#{createdateend,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- </if>
- <if test="createcode != null and createcode != ''">
- AND createcode = #{createcode,jdbcType=VARCHAR}
- </if>
- <if test="confirmdate != null">
- AND DATE_FORMAT(confirmdate, '%Y-%m-%d') = DATE_FORMAT(#{confirmdate,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- </if>
- <if test="confirmcode != null and confirmcode != ''">
- AND confirmcode = #{confirmcode,jdbcType=VARCHAR}
- </if>
- <if test="checkno != null and checkno != ''">
- AND checkno like concat('%', #{checkno,jdbcType=VARCHAR} , '%')
- </if>
- <if test="status != null and status != ''">
- AND status = #{status,jdbcType=VARCHAR}
- </if>
- <if test="account != null and account != ''">
- AND account = #{account,jdbcType=VARCHAR}
- </if>
- <if test="origCommno != null and origCommno != ''">
- AND orig_commno = #{origCommno,jdbcType=VARCHAR}
- </if>
- <if test="updatedatestart != null and updatedateend != null">
- AND DATE_FORMAT(updatedate, '%Y-%m-%d') between DATE_FORMAT(#{updatedatestart,jdbcType=TIMESTAMP},
- '%Y-%m-%d') and DATE_FORMAT(#{updatedateend,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- </if>
- <if test="checkflag != null and checkflag != ''">
- AND checkflag = #{checkflag,jdbcType=CHAR}
- </if>
- <if test="comcode != null and comcode != ''">
- AND comcode like concat(#{comcode,jdbcType=VARCHAR},'%')
- </if>
- <if test="url != null and url != ''">
- AND url = #{url,jdbcType=CHAR}
- </if>
- ORDER BY updatedate desc
- </select>
- <select id="getCountBySettleno" resultType="java.lang.Integer">
- select count(0)
- from ins_settle
- where settleno like concat(#{settleno}, '%')
- </select>
- <select id="generateBeforePolicyno" parameterType="com.ydtech.modules.ins.model.vo.req.InsCminReqVo"
- resultType="com.ydtech.modules.ins.model.vo.PolicynoDetailResVo">
- SELECT
- a.policyno policyno,
- b.riskcode riskcode,
- IFNULL(c.proname,e.name) riskname,
- b.inscompany inscompany,
- d.name inscompanyname,
- b.comcode comcode,
- f.name comname,
- b.appliname appliname,
- b.applicode applicode,
- b.insuredcode insuredcode,
- b.insuredname insuredname,
- b.operatedate operatedate,
- b.startdate startdate,
- b.sumpremium sumpremium,
- b.notaxpremium notaxpremium,
- b.commissionrate commissionrate,
- a.commission - a.doingcommission - a.finalcommission commission
- FROM
- ins_income a
- LEFT JOIN ins_cmain b ON a.policyno = b.policyno
- LEFT JOIN esm_product_fc c ON c.planno = b.riskcode
- LEFT JOIN esm_product e ON e.id = b.riskcode
- LEFT JOIN esm_ins_company d ON b.inscompany = d.id
- LEFT JOIN sys_dept f on f.id=b.comcode
- WHERE 1=1
- <if test="inscompany != null and inscompany != ''">
- AND b.inscompany LIKE concat('%', #{inscompany},'%')
- </if>
- <if test="operatedatestart != null and operatedateend !=null">
- AND DATE_FORMAT(b.operatedate, '%Y-%m-%d') BETWEEN DATE_FORMAT(#{operatedatestart}, '%Y-%m-%d') AND
- DATE_FORMAT(#{operatedateend}, '%Y-%m-%d')
- </if>
- <if test="creattime != null ">
- AND DATE_FORMAT(a.creattime, '%Y-%m-%d') BETWEEN DATE_FORMAT(#{creattime}, '%Y-%m-%d') AND
- DATE_FORMAT(#{creattime}, '%Y-%m-%d')
- </if>
- <if test="riskcode != null and riskcode != ''">
- AND b.riskcode = #{riskcode}
- </if>
- <if test="comcode != null and comcode != ''">
- AND b.comcode LIKE concat(#{comcode},'%')
- </if>
- AND (a.commission - a.doingcommission - a.finalcommission != 0)
- ORDER BY
- a.POLICYNO
- </select>
- <select id="selectBySettlenoAndStatus" resultType="com.ydtech.modules.ins.model.InsSettle">
- select
- <include refid="Base_Column_List"/>
- from ins_settle
- where settleno = #{settleno} and status=#{status}
- </select>
- <select id="selectBySettlenoAndCheckflag" resultType="java.lang.Integer">
- select count(1)
- from ins_settle
- where settleno = #{settleno}
- and checkflag = #{checkflag}
- </select>
- <select id="selectByCheckno" resultType="com.ydtech.modules.ins.model.InsSettle">
- select
- <include refid="Base_Column_List"/>
- from ins_settle
- where checkno=#{checkno}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete
- from ins_settle
- where settleno = #{settleno,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.ydtech.modules.ins.model.InsSettle">
- insert into ins_settle (settleno, billfee, insurercode,
- createdate, createcode, confirmdate,
- confirmcode, checkno, status,
- account, orig_commno, updatedate,
- checkflag, comcode,
- oppbank,
- oppbankname,
- oppact,
- oppactname)
- values (#{settleno,jdbcType=VARCHAR}, #{billfee,jdbcType=DECIMAL}, #{insurercode,jdbcType=VARCHAR},
- #{createdate,jdbcType=TIMESTAMP}, #{createcode,jdbcType=VARCHAR}, #{confirmdate,jdbcType=TIMESTAMP},
- #{confirmcode,jdbcType=VARCHAR}, #{checkno,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
- #{account,jdbcType=VARCHAR}, #{origCommno,jdbcType=VARCHAR}, #{updatedate,jdbcType=TIMESTAMP},
- #{checkflag,jdbcType=CHAR}, #{comcode,jdbcType=VARCHAR},
- #{oppbank,jdbcType=VARCHAR},
- #{oppbankname,jdbcType=VARCHAR},
- #{oppact,jdbcType=VARCHAR},
- #{oppactname,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.ydtech.modules.ins.model.InsSettle">
- insert into ins_settle
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="settleno != null">
- settleno,
- </if>
- <if test="billfee != null">
- billfee,
- </if>
- <if test="insurercode != null">
- insurercode,
- </if>
- <if test="createdate != null">
- createdate,
- </if>
- <if test="createcode != null">
- createcode,
- </if>
- <if test="confirmdate != null">
- confirmdate,
- </if>
- <if test="confirmcode != null">
- confirmcode,
- </if>
- <if test="checkno != null">
- checkno,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="account != null">
- account,
- </if>
- <if test="origCommno != null">
- orig_commno,
- </if>
- <if test="updatedate != null">
- updatedate,
- </if>
- <if test="checkflag != null">
- checkflag,
- </if>
- <if test="comcode != null">
- comcode,
- </if>
- <if test="oppbank != null">
- oppbank,
- </if>
- <if test="oppbankname != null">
- oppbankname,
- </if>
- <if test="oppact != null">
- oppact,
- </if>
- <if test="oppactname != null">
- oppactname,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="settleno != null">
- #{settleno,jdbcType=VARCHAR},
- </if>
- <if test="billfee != null">
- #{billfee,jdbcType=DECIMAL},
- </if>
- <if test="insurercode != null">
- #{insurercode,jdbcType=VARCHAR},
- </if>
- <if test="createdate != null">
- #{createdate,jdbcType=TIMESTAMP},
- </if>
- <if test="createcode != null">
- #{createcode,jdbcType=VARCHAR},
- </if>
- <if test="confirmdate != null">
- #{confirmdate,jdbcType=TIMESTAMP},
- </if>
- <if test="confirmcode != null">
- #{confirmcode,jdbcType=VARCHAR},
- </if>
- <if test="checkno != null">
- #{checkno,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=VARCHAR},
- </if>
- <if test="account != null">
- #{account,jdbcType=VARCHAR},
- </if>
- <if test="origCommno != null">
- #{origCommno,jdbcType=VARCHAR},
- </if>
- <if test="updatedate != null">
- #{updatedate,jdbcType=TIMESTAMP},
- </if>
- <if test="checkflag != null">
- #{checkflag,jdbcType=CHAR},
- </if>
- <if test="comcode != null">
- #{comcode,jdbcType=CHAR},
- </if>
- <if test="oppbank != null">
- #{oppbank,jdbcType=VARCHAR},
- </if>
- <if test="oppbankname != null">
- #{oppbankname,jdbcType=VARCHAR},
- </if>
- <if test="oppact != null">
- #{oppact,jdbcType=VARCHAR},
- </if>
- <if test="oppactname != null">
- #{oppactname,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.ins.model.InsSettle">
- update ins_settle
- <set>
- <if test="billfee != null">
- billfee = #{billfee,jdbcType=DECIMAL},
- </if>
- <if test="insurercode != null">
- insurercode = #{insurercode,jdbcType=VARCHAR},
- </if>
- <if test="createdate != null">
- createdate = #{createdate,jdbcType=TIMESTAMP},
- </if>
- <if test="createcode != null">
- createcode = #{createcode,jdbcType=VARCHAR},
- </if>
- <if test="confirmdate != null">
- confirmdate = #{confirmdate,jdbcType=TIMESTAMP},
- </if>
- <if test="confirmcode != null">
- confirmcode = #{confirmcode,jdbcType=VARCHAR},
- </if>
- <if test="checkno != null">
- checkno = #{checkno,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=VARCHAR},
- </if>
- <if test="account != null">
- account = #{account,jdbcType=VARCHAR},
- </if>
- <if test="origCommno != null">
- orig_commno = #{origCommno,jdbcType=VARCHAR},
- </if>
- <if test="updatedate != null">
- updatedate = #{updatedate,jdbcType=TIMESTAMP},
- </if>
- <if test="checkflag != null">
- checkflag = #{checkflag,jdbcType=CHAR},
- </if>
- <if test="comcode != null">
- comcode = #{comcode,jdbcType=VARCHAR},
- </if>
- <if test="oppbank != null">
- oppbank = #{oppbank,jdbcType=VARCHAR},
- </if>
- <if test="oppbankname != null">
- oppbankname = #{oppbankname,jdbcType=VARCHAR},
- </if>
- <if test="oppact != null">
- oppact = #{oppact,jdbcType=VARCHAR},
- </if>
- <if test="oppactname != null">
- oppactname = #{oppactname,jdbcType=VARCHAR},
- </if>
- <if test="fileid != null and fileid != '' ">
- fileid = #{fileid,jdbcType=VARCHAR},
- </if>
- </set>
- where settleno = #{settleno,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.ydtech.modules.ins.model.InsSettle">
- update ins_settle
- set billfee = #{billfee,jdbcType=DECIMAL},
- insurercode = #{insurercode,jdbcType=VARCHAR},
- createdate = #{createdate,jdbcType=TIMESTAMP},
- createcode = #{createcode,jdbcType=VARCHAR},
- confirmdate = #{confirmdate,jdbcType=TIMESTAMP},
- confirmcode = #{confirmcode,jdbcType=VARCHAR},
- checkno = #{checkno,jdbcType=VARCHAR},
- status = #{status,jdbcType=VARCHAR},
- account = #{account,jdbcType=VARCHAR},
- orig_commno = #{origCommno,jdbcType=VARCHAR},
- updatedate = #{updatedate,jdbcType=TIMESTAMP},
- checkflag = #{checkflag,jdbcType=CHAR},
- comcode = #{comcode,jdbcType=VARCHAR},
- oppbank = #{oppbank,jdbcType=VARCHAR},
- oppbankname = #{oppbankname,jdbcType=VARCHAR},
- oppact = #{oppact,jdbcType=VARCHAR},
- fileid = #{fileid,jdbcType=VARCHAR},
- oppactname = #{oppactname,jdbcType=VARCHAR}
- where settleno = #{settleno,jdbcType=VARCHAR}
- </update>
- <update id="updateFileid" parameterType="com.ydtech.modules.ins.model.InsSettle">
- update ins_settle
- set fileid = #{fileid,jdbcType=VARCHAR},
- url = #{url,jdbcType=VARCHAR}
- where settleno = #{settleno,jdbcType=VARCHAR}
- </update>
- </mapper>
|