BasicDataMapper.xml 17.8 KB
<?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.lhcredit.project.model.basicData.mapper.BasicDataMapper">

    <resultMap type="BasicData" id="BasicDataResult">
        <result property="id"    column="id"    />
        <result property="qcnum"    column="qcnum"    />
        <result property="sign"    column="sign"    />
        <result property="cp"    column="cp"    />
        <result property="dkffsj"    column="dkffsj"    />
        <result property="bgyf"    column="bgyf"    />
        <result property="xzdk"    column="xzdk"    />
        <result property="xzdkdybs"    column="xzdkdybs"    />
        <result property="xzdkdykhs"    column="xzdkdykhs"    />
        <result property="dysdbj"    column="dysdbj"    />
        <result property="dysdlx"    column="dysdlx"    />
        <result property="ymbjye"    column="ymbjye"    />
        <result property="srbjce"    column="srbjce"    />
        <result property="srlxce"    column="srlxce"    />
        <result property="bjyece"    column="bjyece"    />
        <result property="bj"    column="bj"    />
        <result property="zclx"    column="zclx"    />
        <result property="zcbj"    column="zcbj"    />
        <result property="zcbx"    column="zcbx"    />
        <result property="dyhxbj"    column="dyhxbj"    />
        <result property="tqbjh"    column="tqbjh"    />
        <result property="tq1"    column="tq1"    />
        <result property="tq2"    column="tq2"    />
        <result property="tq3"    column="tq3"    />
        <result property="tq4"    column="tq4"    />
        <result property="tq5"    column="tq5"    />
        <result property="tq6"    column="tq6"    />
        <result property="tq7"    column="tq7"    />
        <result property="hsbjh"    column="hsbjh"    />
        <result property="bjtq1"    column="bjtq1"    />
        <result property="bjtq2"    column="bjtq2"    />
        <result property="bjtq3"    column="bjtq3"    />
        <result property="bjtq4"    column="bjtq4"    />
        <result property="bjtq5"    column="bjtq5"    />
        <result property="bjtq6"    column="bjtq6"    />
        <result property="bjtq7"    column="bjtq7"    />
        <result property="hsjeh"    column="hsjeh"    />
        <result property="jetq1"    column="jetq1"    />
        <result property="jetq2"    column="jetq2"    />
        <result property="jetq3"    column="jetq3"    />
        <result property="jetq4"    column="jetq4"    />
        <result property="jetq5"    column="jetq5"    />
        <result property="jetq6"    column="jetq6"    />
        <result property="jetq7"    column="jetq7"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="xzwyl"    column="xzwyl"    />
        <result property="ljwyl"    column="ljwyl"    />
        <result property="qcwcbjzb"    column="qcwcbjzb"    />
    </resultMap>

    <sql id="selectBasicDataVo">
        select id, qcnum, sign, cp, dkffsj, bgyf, xzdk, xzdkdybs, xzdkdykhs, dysdbj, dysdlx, ymbjye, srbjce, srlxce, bjyece, bj, zclx, zcbj, zcbx, dyhxbj, tqbjh, tq1, tq2, tq3, tq4, tq5, tq6, tq7, hsbjh, bjtq1, bjtq2, bjtq3, bjtq4, bjtq5, bjtq6, bjtq7, hsjeh, jetq1, jetq2, jetq3, jetq4, jetq5, jetq6, jetq7, del_flag, xzwyl, ljwyl, qcwcbjzb from model_basic_data
    </sql>

    <sql id="basicDataVo">
        id, qcnum, sign, cp, dkffsj, bgyf, xzdk, xzdkdybs, xzdkdykhs, dysdbj, dysdlx, ymbjye, srbjce, srlxce, bjyece, bj, zclx, zcbj, zcbx, dyhxbj, tqbjh, tq1, tq2, tq3, tq4, tq5, tq6, tq7, hsbjh, bjtq1, bjtq2, bjtq3, bjtq4, bjtq5, bjtq6, bjtq7, hsjeh, jetq1, jetq2, jetq3, jetq4, jetq5, jetq6, jetq7, del_flag, xzwyl, ljwyl, qcwcbjzb
    </sql>

    <select id="selectBasicDataList" parameterType="BasicData" resultMap="BasicDataResult">
        <include refid="selectBasicDataVo"/>
        <where>
            <if test="id != null "> and id = #{id}</if>
            <if test="qcnum != null "> and qcnum = #{qcnum}</if>
            <if test="sign != null  and sign != '' "> and sign = #{sign}</if>
            <if test="cp != null  and cp != '' "> and cp = #{cp}</if>
            <if test="dkffsj != null "> and dkffsj = #{dkffsj}</if>
            <if test="bgyf != null "> and bgyf = #{bgyf}</if>
            <if test="xzdk != null "> and xzdk = #{xzdk}</if>
            <if test="xzdkdybs != null "> and xzdkdybs = #{xzdkdybs}</if>
            <if test="xzdkdykhs != null "> and xzdkdykhs = #{xzdkdykhs}</if>
            <if test="dysdbj != null "> and dysdbj = #{dysdbj}</if>
            <if test="dysdlx != null "> and dysdlx = #{dysdlx}</if>
            <if test="ymbjye != null "> and ymbjye = #{ymbjye}</if>
            <if test="srbjce != null "> and srbjce = #{srbjce}</if>
            <if test="srlxce != null "> and srlxce = #{srlxce}</if>
            <if test="bjyece != null "> and bjyece = #{bjyece}</if>
            <if test="bj != null "> and bj = #{bj}</if>
            <if test="zclx != null "> and zclx = #{zclx}</if>
            <if test="zcbj != null "> and zcbj = #{zcbj}</if>
            <if test="zcbx != null "> and zcbx = #{zcbx}</if>
            <if test="dyhxbj != null "> and dyhxbj = #{dyhxbj}</if>
            <if test="tqbjh != null "> and tqbjh = #{tqbjh}</if>
            <if test="tq1 != null "> and tq1 = #{tq1}</if>
            <if test="tq2 != null "> and tq2 = #{tq2}</if>
            <if test="tq3 != null "> and tq3 = #{tq3}</if>
            <if test="tq4 != null "> and tq4 = #{tq4}</if>
            <if test="tq5 != null "> and tq5 = #{tq5}</if>
            <if test="tq6 != null "> and tq6 = #{tq6}</if>
            <if test="tq7 != null "> and tq7 = #{tq7}</if>
            <if test="hsbjh != null "> and hsbjh = #{hsbjh}</if>
            <if test="bjtq1 != null "> and bjtq1 = #{bjtq1}</if>
            <if test="bjtq2 != null "> and bjtq2 = #{bjtq2}</if>
            <if test="bjtq3 != null "> and bjtq3 = #{bjtq3}</if>
            <if test="bjtq4 != null "> and bjtq4 = #{bjtq4}</if>
            <if test="bjtq5 != null "> and bjtq5 = #{bjtq5}</if>
            <if test="bjtq6 != null "> and bjtq6 = #{bjtq6}</if>
            <if test="bjtq7 != null "> and bjtq7 = #{bjtq7}</if>
            <if test="hsjeh != null "> and hsjeh = #{hsjeh}</if>
            <if test="jetq1 != null "> and jetq1 = #{jetq1}</if>
            <if test="jetq2 != null "> and jetq2 = #{jetq2}</if>
            <if test="jetq3 != null "> and jetq3 = #{jetq3}</if>
            <if test="jetq4 != null "> and jetq4 = #{jetq4}</if>
            <if test="jetq5 != null "> and jetq5 = #{jetq5}</if>
            <if test="jetq6 != null "> and jetq6 = #{jetq6}</if>
            <if test="jetq7 != null "> and jetq7 = #{jetq7}</if>
            <if test="delFlag != null  and delFlag != '' "> and del_flag = #{delFlag}</if>
            <if test="xzwyl != null "> and xzwyl = #{xzwyl}</if>
            <if test="ljwyl != null "> and ljwyl = #{ljwyl}</if>
            <if test="qcwcbjzb != null "> and qcwcbjzb = #{qcwcbjzb}</if>
        </where>
    </select>

    <select id="selectBasicDataById" parameterType="Long" resultMap="BasicDataResult">
        <include refid="selectBasicDataVo"/>
        where id = #{id}
    </select>

    <insert id="insertBasicData" parameterType="BasicData" useGeneratedKeys="true" keyProperty="id">
        insert into model_basic_data
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="qcnum != null  ">qcnum,</if>
            <if test="sign != null  and sign != ''  ">sign,</if>
            <if test="cp != null  and cp != ''  ">cp,</if>
            <if test="dkffsj != null  ">dkffsj,</if>
            <if test="bgyf != null  ">bgyf,</if>
            <if test="xzdk != null  ">xzdk,</if>
            <if test="xzdkdybs != null  ">xzdkdybs,</if>
            <if test="xzdkdykhs != null  ">xzdkdykhs,</if>
            <if test="dysdbj != null  ">dysdbj,</if>
            <if test="dysdlx != null  ">dysdlx,</if>
            <if test="ymbjye != null  ">ymbjye,</if>
            <if test="srbjce != null  ">srbjce,</if>
            <if test="srlxce != null  ">srlxce,</if>
            <if test="bjyece != null  ">bjyece,</if>
            <if test="bj != null  ">bj,</if>
            <if test="zclx != null  ">zclx,</if>
            <if test="zcbj != null  ">zcbj,</if>
            <if test="zcbx != null  ">zcbx,</if>
            <if test="dyhxbj != null  ">dyhxbj,</if>
            <if test="tqbjh != null  ">tqbjh,</if>
            <if test="tq1 != null  ">tq1,</if>
            <if test="tq2 != null  ">tq2,</if>
            <if test="tq3 != null  ">tq3,</if>
            <if test="tq4 != null  ">tq4,</if>
            <if test="tq5 != null  ">tq5,</if>
            <if test="tq6 != null  ">tq6,</if>
            <if test="tq7 != null  ">tq7,</if>
            <if test="hsbjh != null  ">hsbjh,</if>
            <if test="bjtq1 != null  ">bjtq1,</if>
            <if test="bjtq2 != null  ">bjtq2,</if>
            <if test="bjtq3 != null  ">bjtq3,</if>
            <if test="bjtq4 != null  ">bjtq4,</if>
            <if test="bjtq5 != null  ">bjtq5,</if>
            <if test="bjtq6 != null  ">bjtq6,</if>
            <if test="bjtq7 != null  ">bjtq7,</if>
            <if test="hsjeh != null  ">hsjeh,</if>
            <if test="jetq1 != null  ">jetq1,</if>
            <if test="jetq2 != null  ">jetq2,</if>
            <if test="jetq3 != null  ">jetq3,</if>
            <if test="jetq4 != null  ">jetq4,</if>
            <if test="jetq5 != null  ">jetq5,</if>
            <if test="jetq6 != null  ">jetq6,</if>
            <if test="jetq7 != null  ">jetq7,</if>
            <if test="delFlag != null  and delFlag != ''  ">del_flag,</if>
            <if test="xzwyl != null  ">xzwyl,</if>
            <if test="ljwyl != null  ">ljwyl,</if>
            <if test="qcwcbjzb != null  ">qcwcbjzb,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="qcnum != null  ">#{qcnum},</if>
            <if test="sign != null  and sign != ''  ">#{sign},</if>
            <if test="cp != null  and cp != ''  ">#{cp},</if>
            <if test="dkffsj != null  ">#{dkffsj},</if>
            <if test="bgyf != null  ">#{bgyf},</if>
            <if test="xzdk != null  ">#{xzdk},</if>
            <if test="xzdkdybs != null  ">#{xzdkdybs},</if>
            <if test="xzdkdykhs != null  ">#{xzdkdykhs},</if>
            <if test="dysdbj != null  ">#{dysdbj},</if>
            <if test="dysdlx != null  ">#{dysdlx},</if>
            <if test="ymbjye != null  ">#{ymbjye},</if>
            <if test="srbjce != null  ">#{srbjce},</if>
            <if test="srlxce != null  ">#{srlxce},</if>
            <if test="bjyece != null  ">#{bjyece},</if>
            <if test="bj != null  ">#{bj},</if>
            <if test="zclx != null  ">#{zclx},</if>
            <if test="zcbj != null  ">#{zcbj},</if>
            <if test="zcbx != null  ">#{zcbx},</if>
            <if test="dyhxbj != null  ">#{dyhxbj},</if>
            <if test="tqbjh != null  ">#{tqbjh},</if>
            <if test="tq1 != null  ">#{tq1},</if>
            <if test="tq2 != null  ">#{tq2},</if>
            <if test="tq3 != null  ">#{tq3},</if>
            <if test="tq4 != null  ">#{tq4},</if>
            <if test="tq5 != null  ">#{tq5},</if>
            <if test="tq6 != null  ">#{tq6},</if>
            <if test="tq7 != null  ">#{tq7},</if>
            <if test="hsbjh != null  ">#{hsbjh},</if>
            <if test="bjtq1 != null  ">#{bjtq1},</if>
            <if test="bjtq2 != null  ">#{bjtq2},</if>
            <if test="bjtq3 != null  ">#{bjtq3},</if>
            <if test="bjtq4 != null  ">#{bjtq4},</if>
            <if test="bjtq5 != null  ">#{bjtq5},</if>
            <if test="bjtq6 != null  ">#{bjtq6},</if>
            <if test="bjtq7 != null  ">#{bjtq7},</if>
            <if test="hsjeh != null  ">#{hsjeh},</if>
            <if test="jetq1 != null  ">#{jetq1},</if>
            <if test="jetq2 != null  ">#{jetq2},</if>
            <if test="jetq3 != null  ">#{jetq3},</if>
            <if test="jetq4 != null  ">#{jetq4},</if>
            <if test="jetq5 != null  ">#{jetq5},</if>
            <if test="jetq6 != null  ">#{jetq6},</if>
            <if test="jetq7 != null  ">#{jetq7},</if>
            <if test="delFlag != null  and delFlag != ''  ">#{delFlag},</if>
            <if test="xzwyl != null  ">#{xzwyl},</if>
            <if test="ljwyl != null  ">#{ljwyl},</if>
            <if test="qcwcbjzb != null  ">#{qcwcbjzb},</if>
        </trim>
    </insert>

    <update id="updateBasicData" parameterType="BasicData">
        update model_basic_data
        <trim prefix="SET" suffixOverrides=",">
            <if test="qcnum != null  ">qcnum = #{qcnum},</if>
            <if test="sign != null  and sign != ''  ">sign = #{sign},</if>
            <if test="cp != null  and cp != ''  ">cp = #{cp},</if>
            <if test="dkffsj != null  ">dkffsj = #{dkffsj},</if>
            <if test="bgyf != null  ">bgyf = #{bgyf},</if>
            <if test="xzdk != null  ">xzdk = #{xzdk},</if>
            <if test="xzdkdybs != null  ">xzdkdybs = #{xzdkdybs},</if>
            <if test="xzdkdykhs != null  ">xzdkdykhs = #{xzdkdykhs},</if>
            <if test="dysdbj != null  ">dysdbj = #{dysdbj},</if>
            <if test="dysdlx != null  ">dysdlx = #{dysdlx},</if>
            <if test="ymbjye != null  ">ymbjye = #{ymbjye},</if>
            <if test="srbjce != null  ">srbjce = #{srbjce},</if>
            <if test="srlxce != null  ">srlxce = #{srlxce},</if>
            <if test="bjyece != null  ">bjyece = #{bjyece},</if>
            <if test="bj != null  ">bj = #{bj},</if>
            <if test="zclx != null  ">zclx = #{zclx},</if>
            <if test="zcbj != null  ">zcbj = #{zcbj},</if>
            <if test="zcbx != null  ">zcbx = #{zcbx},</if>
            <if test="dyhxbj != null  ">dyhxbj = #{dyhxbj},</if>
            <if test="tqbjh != null  ">tqbjh = #{tqbjh},</if>
            <if test="tq1 != null  ">tq1 = #{tq1},</if>
            <if test="tq2 != null  ">tq2 = #{tq2},</if>
            <if test="tq3 != null  ">tq3 = #{tq3},</if>
            <if test="tq4 != null  ">tq4 = #{tq4},</if>
            <if test="tq5 != null  ">tq5 = #{tq5},</if>
            <if test="tq6 != null  ">tq6 = #{tq6},</if>
            <if test="tq7 != null  ">tq7 = #{tq7},</if>
            <if test="hsbjh != null  ">hsbjh = #{hsbjh},</if>
            <if test="bjtq1 != null  ">bjtq1 = #{bjtq1},</if>
            <if test="bjtq2 != null  ">bjtq2 = #{bjtq2},</if>
            <if test="bjtq3 != null  ">bjtq3 = #{bjtq3},</if>
            <if test="bjtq4 != null  ">bjtq4 = #{bjtq4},</if>
            <if test="bjtq5 != null  ">bjtq5 = #{bjtq5},</if>
            <if test="bjtq6 != null  ">bjtq6 = #{bjtq6},</if>
            <if test="bjtq7 != null  ">bjtq7 = #{bjtq7},</if>
            <if test="hsjeh != null  ">hsjeh = #{hsjeh},</if>
            <if test="jetq1 != null  ">jetq1 = #{jetq1},</if>
            <if test="jetq2 != null  ">jetq2 = #{jetq2},</if>
            <if test="jetq3 != null  ">jetq3 = #{jetq3},</if>
            <if test="jetq4 != null  ">jetq4 = #{jetq4},</if>
            <if test="jetq5 != null  ">jetq5 = #{jetq5},</if>
            <if test="jetq6 != null  ">jetq6 = #{jetq6},</if>
            <if test="jetq7 != null  ">jetq7 = #{jetq7},</if>
            <if test="delFlag != null  and delFlag != ''  ">del_flag = #{delFlag},</if>
            <if test="xzwyl != null  ">xzwyl = #{xzwyl},</if>
            <if test="ljwyl != null  ">ljwyl = #{ljwyl},</if>
            <if test="qcwcbjzb != null  ">qcwcbjzb = #{qcwcbjzb},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteBasicDataById" parameterType="Long">
        delete from model_basic_data where id = #{id}
    </delete>

    <delete id="deleteBasicDataByIds" parameterType="String">
        delete from model_basic_data where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

    <insert id="insertData" parameterType="BasicData">
        insert into model_basic_data (
        <include refid="basicDataVo"/>
        )
        values
        <foreach collection="list" item="item" index="index" separator=", ">(
            #{item.id},
            #{item.qcnum},
            #{item.sign},
            #{item.cp},
            #{item.dkffsj},
            #{item.bgyf},
            #{item.xzdk},
            #{item.xzdkdybs},
            #{item.xzdkdykhs},
            #{item.dysdbj},
            #{item.dysdlx},
            #{item.ymbjye},
            #{item.srbjce},
            #{item.srlxce},
            #{item.bjyece},
            #{item.bj},
            #{item.zclx},
            #{item.zcbj},
            #{item.zcbx},
            #{item.dyhxbj},
            #{item.tqbjh},
            #{item.tq1},
            #{item.tq2},
            #{item.tq3},
            #{item.tq4},
            #{item.tq5},
            #{item.tq6},
            #{item.tq7},
            #{item.hsbjh},
            #{item.bjtq1},
            #{item.bjtq2},
            #{item.bjtq3},
            #{item.bjtq4},
            #{item.bjtq5},
            #{item.bjtq6},
            #{item.bjtq7},
            #{item.hsjeh},
            #{item.jetq1},
            #{item.jetq2},
            #{item.jetq3},
            #{item.jetq4},
            #{item.jetq5},
            #{item.jetq6},
            #{item.jetq7},
            #{item.delFlag},
            #{item.xzwyl},
            #{item.ljwyl},
            #{item.qcwcbjzb}
            )
        </foreach>
        on duplicate key update
        xzwyl=values(xzwyl),
        ljwyl=values(ljwyl),
        qcwcbjzb =values(qcwcbjzb)
    </insert>

    <select id="getBasicData" parameterType="BasicData" resultMap="BasicDataResult">
        <include refid="selectBasicDataVo"/>
        <where>
            <if test="qcnum != null "> and qcnum = #{qcnum}</if>
            <if test="sign != null "> and sign = #{sign}</if>
            <if test="delFlag != null  and delFlag != '' "> and del_flag = #{delFlag}</if>
        </where>
        order by id asc
    </select>
</mapper>