| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336 |
- <?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.fnc.dao.FncVouBusinessMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.fnc.model.FncVouBusiness">
- <result column="c_seq_no" jdbcType="VARCHAR" property="cSeqNo"/>
- <result column="policyno" jdbcType="VARCHAR" property="policyno"/>
- <result column="notaxpremium" jdbcType="DOUBLE" property="notaxpremium"/>
- <result column="commissionrate" jdbcType="DOUBLE" property="commissionrate"/>
- <result column="commission" jdbcType="DOUBLE" property="commission"/>
- <result column="settleno" jdbcType="VARCHAR" property="settleno"/>
- <result column="billfee" jdbcType="DOUBLE" property="billfee"/>
- <result column="inputdate" jdbcType="TIMESTAMP" property="inputdate"/>
- <result column="agentcode" jdbcType="VARCHAR" property="agentcode"/>
- <result column="comcode" jdbcType="VARCHAR" property="comcode"/>
- <result column="inscompany" jdbcType="VARCHAR" property="inscompany"/>
- </resultMap>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="("
- separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="("
- separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- c_seq_no, policyno, notaxpremium, commissionrate, commission, settleno, billfee,
- inputdate, agentcode, comcode, inscompany
- </sql>
- <select id="selectByExample" parameterType="com.ydtech.modules.fnc.model.FncVouBusinessExample"
- resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- 'true' as QUERYID,
- <include refid="Base_Column_List"/>
- from fnc_vou_business
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <delete id="deleteByExample" parameterType="com.ydtech.modules.fnc.model.FncVouBusinessExample">
- delete from fnc_vou_business
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- </delete>
- <insert id="insert" parameterType="com.ydtech.modules.fnc.model.FncVouBusiness">
- insert into fnc_vou_business (c_seq_no, policyno, notaxpremium,
- commissionrate, commission, settleno,
- billfee, inputdate, agentcode,
- comcode, inscompany)
- values (#{cSeqNo,jdbcType=VARCHAR}, #{policyno,jdbcType=VARCHAR}, #{notaxpremium,jdbcType=DOUBLE},
- #{commissionrate,jdbcType=DOUBLE}, #{commission,jdbcType=DOUBLE}, #{settleno,jdbcType=VARCHAR},
- #{billfee,jdbcType=DOUBLE}, #{inputdate,jdbcType=TIMESTAMP}, #{agentcode,jdbcType=VARCHAR},
- #{comcode,jdbcType=VARCHAR}, #{inscompany,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.ydtech.modules.fnc.model.FncVouBusiness">
- insert into fnc_vou_business
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="cSeqNo != null">
- c_seq_no,
- </if>
- <if test="policyno != null">
- policyno,
- </if>
- <if test="notaxpremium != null">
- notaxpremium,
- </if>
- <if test="commissionrate != null">
- commissionrate,
- </if>
- <if test="commission != null">
- commission,
- </if>
- <if test="settleno != null">
- settleno,
- </if>
- <if test="billfee != null">
- billfee,
- </if>
- <if test="inputdate != null">
- inputdate,
- </if>
- <if test="agentcode != null">
- agentcode,
- </if>
- <if test="comcode != null">
- comcode,
- </if>
- <if test="inscompany != null">
- inscompany,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="cSeqNo != null">
- #{cSeqNo,jdbcType=VARCHAR},
- </if>
- <if test="policyno != null">
- #{policyno,jdbcType=VARCHAR},
- </if>
- <if test="notaxpremium != null">
- #{notaxpremium,jdbcType=DOUBLE},
- </if>
- <if test="commissionrate != null">
- #{commissionrate,jdbcType=DOUBLE},
- </if>
- <if test="commission != null">
- #{commission,jdbcType=DOUBLE},
- </if>
- <if test="settleno != null">
- #{settleno,jdbcType=VARCHAR},
- </if>
- <if test="billfee != null">
- #{billfee,jdbcType=DOUBLE},
- </if>
- <if test="inputdate != null">
- #{inputdate,jdbcType=TIMESTAMP},
- </if>
- <if test="agentcode != null">
- #{agentcode,jdbcType=VARCHAR},
- </if>
- <if test="comcode != null">
- #{comcode,jdbcType=VARCHAR},
- </if>
- <if test="inscompany != null">
- #{inscompany,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.ydtech.modules.fnc.model.FncVouBusinessExample"
- resultType="java.lang.Long">
- select count(*) from fnc_vou_business
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update fnc_vou_business
- <set>
- <if test="record.cSeqNo != null">
- c_seq_no = #{record.cSeqNo,jdbcType=VARCHAR},
- </if>
- <if test="record.policyno != null">
- policyno = #{record.policyno,jdbcType=VARCHAR},
- </if>
- <if test="record.notaxpremium != null">
- notaxpremium = #{record.notaxpremium,jdbcType=DOUBLE},
- </if>
- <if test="record.commissionrate != null">
- commissionrate = #{record.commissionrate,jdbcType=DOUBLE},
- </if>
- <if test="record.commission != null">
- commission = #{record.commission,jdbcType=DOUBLE},
- </if>
- <if test="record.settleno != null">
- settleno = #{record.settleno,jdbcType=VARCHAR},
- </if>
- <if test="record.billfee != null">
- billfee = #{record.billfee,jdbcType=DOUBLE},
- </if>
- <if test="record.inputdate != null">
- inputdate = #{record.inputdate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.agentcode != null">
- agentcode = #{record.agentcode,jdbcType=VARCHAR},
- </if>
- <if test="record.comcode != null">
- comcode = #{record.comcode,jdbcType=VARCHAR},
- </if>
- <if test="record.inscompany != null">
- inscompany = #{record.inscompany,jdbcType=VARCHAR},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause"/>
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update fnc_vou_business
- set c_seq_no = #{record.cSeqNo,jdbcType=VARCHAR},
- policyno = #{record.policyno,jdbcType=VARCHAR},
- notaxpremium = #{record.notaxpremium,jdbcType=DOUBLE},
- commissionrate = #{record.commissionrate,jdbcType=DOUBLE},
- commission = #{record.commission,jdbcType=DOUBLE},
- settleno = #{record.settleno,jdbcType=VARCHAR},
- billfee = #{record.billfee,jdbcType=DOUBLE},
- inputdate = #{record.inputdate,jdbcType=TIMESTAMP},
- agentcode = #{record.agentcode,jdbcType=VARCHAR},
- comcode = #{record.comcode,jdbcType=VARCHAR},
- inscompany = #{record.inscompany,jdbcType=VARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause"/>
- </if>
- </update>
- <select id="selectBillfeeByAgentcode" parameterType="java.lang.String" resultMap="BaseResultMap">
- select agentcode, SUBSTR(comcode, 1, 5) comcode, sum(a.billfee) billfee
- from fnc_vou_business a
- where DATE_FORMAT(inputdate, '%Y-%m-%d') = DATE_FORMAT(#{inputdate,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and policyno is null
- and settleno is not null
- and inscompany like '100001%'
- group by agentcode, SUBSTR(comcode, 1, 5)
- </select>
- <select id="selectBillfeeByInscompany" parameterType="java.lang.String" resultMap="BaseResultMap">
- select inscompany, substring_index(comcode, 'D', 1) comcode, sum(a.billfee) billfee
- from fnc_vou_business a
- where DATE_FORMAT(inputdate, '%Y-%m-%d') = DATE_FORMAT(#{inputdate,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and policyno is null
- and settleno is not null
- and inscompany not like '100001%'
- group by inscompany, substring_index(comcode, 'D', 1)
- </select>
- <select id="selectCommissionByAgentcode" parameterType="java.lang.String" resultMap="BaseResultMap">
- select agentcode, SUBSTR(comcode, 1, 5) comcode, sum(a.commission) commission
- from fnc_vou_business a
- where DATE_FORMAT(inputdate, '%Y-%m-%d') = DATE_FORMAT(#{inputdate,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and policyno is not null
- and settleno is null
- and inscompany like '100001%'
- group by agentcode, SUBSTR(comcode, 1, 5)
- </select>
- <select id="selectCommissionByInscompany" parameterType="java.lang.String" resultMap="BaseResultMap">
- select inscompany, substring_index(comcode, 'D', 1) comcode, sum(a.commission) commission
- from fnc_vou_business a
- where DATE_FORMAT(inputdate, '%Y-%m-%d') = DATE_FORMAT(#{inputdate,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and policyno is not null
- and settleno is null
- and inscompany not like '100001%'
- group by inscompany, substring_index(comcode, 'D', 1)
- </select>
- <select id="selectBookCodeByAgentcode" parameterType="java.lang.String" resultType="java.lang.String">
- SELECT book_code
- from fnc_book_agent
- where agentcode = #{agentcode,jdbcType=TIMESTAMP}
- </select>
- <select id="selectBookCodeByComcode" parameterType="java.lang.String" resultType="java.lang.String">
- SELECT book_code
- from fnc_book_com
- where comcode like #{comcode,jdbcType=TIMESTAMP}
- </select>
- <update id="updateSettleVouByAgentcode" parameterType="com.ydtech.modules.fnc.model.FncVouBusiness">
- update fnc_vou_business
- set c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
- where agentcode = #{agentcode,jdbcType=VARCHAR}
- and comcode like concat('%', #{comcode,jdbcType=VARCHAR}, '%')
- and DATE_FORMAT(inputdate, '%Y-%m-%d') = DATE_FORMAT(#{inputdate,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and policyno is null
- and settleno is not null
- </update>
- <update id="updateSettleVouByInscompany" parameterType="com.ydtech.modules.fnc.model.FncVouBusiness">
- update fnc_vou_business
- set c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
- where inscompany = #{inscompany,jdbcType=VARCHAR}
- and comcode like concat('%', #{comcode,jdbcType=VARCHAR}, '%')
- and DATE_FORMAT(inputdate, '%Y-%m-%d') = DATE_FORMAT(#{inputdate,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and policyno is null
- and settleno is not null
- </update>
- <update id="updatePolicyVouByAgentcode" parameterType="com.ydtech.modules.fnc.model.FncVouBusiness">
- update fnc_vou_business
- set c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
- where agentcode = #{agentcode,jdbcType=VARCHAR}
- and comcode like concat('%', #{comcode,jdbcType=VARCHAR}, '%')
- and DATE_FORMAT(inputdate, '%Y-%m-%d') = DATE_FORMAT(#{inputdate,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and policyno is not null
- and settleno is null
- </update>
- <update id="updatePolicyVouByInscompany" parameterType="com.ydtech.modules.fnc.model.FncVouBusiness">
- update fnc_vou_business
- set c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
- where inscompany = #{inscompany,jdbcType=VARCHAR}
- and comcode like concat('%', #{comcode,jdbcType=VARCHAR}, '%')
- and DATE_FORMAT(inputdate, '%Y-%m-%d') = DATE_FORMAT(#{inputdate,jdbcType=TIMESTAMP}, '%Y-%m-%d')
- and policyno is not null
- and settleno is null
- </update>
- </mapper>
|