CreditGrantingRiskMapper.xml 10.4 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.business.creditGrantingRisk.mapper.CreditGrantingRiskMapper">
    
    <resultMap type="CreditGrantingRisk" id="CreditGrantingRiskResult">
        <result property="id"    column="id"    />
        <result property="cgId"    column="cg_id"    />
        <result property="ename"    column="ename"    />
        <result property="jyyc"    column="jyyc"    />
        <result property="xzcf"    column="xzcf"    />
        <result property="hgxzcf"    column="hgxzcf"    />
        <result property="yzwf"    column="yzwf"    />
        <result property="gqcz"    column="gqcz"    />
        <result property="qsgg"    column="qsgg"    />
        <result property="qsxx"    column="qsxx"    />
        <result property="dcdy"    column="dcdy"    />
        <result property="cyjc"    column="cyjc"    />
        <result property="msaj"    column="msaj"    />
        <result property="xzaj"    column="xzaj"    />
        <result property="xsaj"    column="xsaj"    />
        <result property="zxaj"    column="zxaj"    />
        <result property="qzqsypc"    column="qzqsypc"    />
        <result property="fsbqaj"    column="fsbqaj"    />
        <result property="sxbzxr"    column="sxbzxr"    />
        <result property="xzgxf"    column="xzgxf"    />
        <result property="sfxz"    column="sfxz"    />
        <result property="sfpm"    column="sfpm"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateBy"    column="update_by"    />
    </resultMap>
	
	<sql id="selectCreditGrantingRiskVo">
        select id, cg_id, ename, jyyc, xzcf, hgxzcf, yzwf, gqcz, qsgg, qsxx, dcdy, cyjc, msaj, xzaj, xsaj, zxaj, qzqsypc, fsbqaj, sxbzxr, xzgxf, sfxz, sfpm, del_flag, create_time, update_time, update_by from credit_granting_risk
    </sql>
	
    <select id="selectCreditGrantingRiskList" parameterType="CreditGrantingRisk" resultMap="CreditGrantingRiskResult">
        <include refid="selectCreditGrantingRiskVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="cgId != null "> and cg_id = #{cgId}</if>
            <if test="ename != null  and ename != '' "> and ename = #{ename}</if>
            <if test="jyyc != null  and jyyc != '' "> and jyyc = #{jyyc}</if>
            <if test="xzcf != null  and xzcf != '' "> and xzcf = #{xzcf}</if>
            <if test="hgxzcf != null  and hgxzcf != '' "> and hgxzcf = #{hgxzcf}</if>
            <if test="yzwf != null  and yzwf != '' "> and yzwf = #{yzwf}</if>
            <if test="gqcz != null  and gqcz != '' "> and gqcz = #{gqcz}</if>
            <if test="qsgg != null  and qsgg != '' "> and qsgg = #{qsgg}</if>
            <if test="qsxx != null  and qsxx != '' "> and qsxx = #{qsxx}</if>
            <if test="dcdy != null  and dcdy != '' "> and dcdy = #{dcdy}</if>
            <if test="cyjc != null  and cyjc != '' "> and cyjc = #{cyjc}</if>
            <if test="msaj != null  and msaj != '' "> and msaj = #{msaj}</if>
            <if test="xzaj != null  and xzaj != '' "> and xzaj = #{xzaj}</if>
            <if test="xsaj != null  and xsaj != '' "> and xsaj = #{xsaj}</if>
            <if test="zxaj != null  and zxaj != '' "> and zxaj = #{zxaj}</if>
            <if test="qzqsypc != null  and qzqsypc != '' "> and qzqsypc = #{qzqsypc}</if>
            <if test="fsbqaj != null  and fsbqaj != '' "> and fsbqaj = #{fsbqaj}</if>
            <if test="sxbzxr != null  and sxbzxr != '' "> and sxbzxr = #{sxbzxr}</if>
            <if test="xzgxf != null  and xzgxf != '' "> and xzgxf = #{xzgxf}</if>
            <if test="sfxz != null  and sfxz != '' "> and sfxz = #{sfxz}</if>
            <if test="sfpm != null  and sfpm != '' "> and sfpm = #{sfpm}</if>
            <if test="delFlag != null  and delFlag != '' "> and del_flag = #{delFlag}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
            <if test="updateTime != null "> and update_time = #{updateTime}</if>
            <if test="updateBy != null  and updateBy != '' "> and update_by = #{updateBy}</if>
        </where>
    </select>
    
    <select id="selectCreditGrantingRiskById" parameterType="Long" resultMap="CreditGrantingRiskResult">
        <include refid="selectCreditGrantingRiskVo"/>
        where id = #{id}
    </select>
    <select id="selectCreditGrantingRiskByCgId" parameterType="Long" resultMap="CreditGrantingRiskResult">
        <include refid="selectCreditGrantingRiskVo"/>
        where cg_id = #{cgId}
    </select>

    <insert id="insertCreditGrantingRisk" parameterType="CreditGrantingRisk" useGeneratedKeys="true" keyProperty="id">
        insert into credit_granting_risk
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="cgId != null  ">cg_id,</if>
			<if test="ename != null  and ename != ''  ">ename,</if>
			<if test="jyyc != null  and jyyc != ''  ">jyyc,</if>
			<if test="xzcf != null  and xzcf != ''  ">xzcf,</if>
			<if test="hgxzcf != null  and hgxzcf != ''  ">hgxzcf,</if>
			<if test="yzwf != null  and yzwf != ''  ">yzwf,</if>
			<if test="gqcz != null  and gqcz != ''  ">gqcz,</if>
			<if test="qsgg != null  and qsgg != ''  ">qsgg,</if>
			<if test="qsxx != null  and qsxx != ''  ">qsxx,</if>
			<if test="dcdy != null  and dcdy != ''  ">dcdy,</if>
			<if test="cyjc != null  and cyjc != ''  ">cyjc,</if>
			<if test="msaj != null  and msaj != ''  ">msaj,</if>
			<if test="xzaj != null  and xzaj != ''  ">xzaj,</if>
			<if test="xsaj != null  and xsaj != ''  ">xsaj,</if>
			<if test="zxaj != null  and zxaj != ''  ">zxaj,</if>
			<if test="qzqsypc != null  and qzqsypc != ''  ">qzqsypc,</if>
			<if test="fsbqaj != null  and fsbqaj != ''  ">fsbqaj,</if>
			<if test="sxbzxr != null  and sxbzxr != ''  ">sxbzxr,</if>
			<if test="xzgxf != null  and xzgxf != ''  ">xzgxf,</if>
			<if test="sfxz != null  and sfxz != ''  ">sfxz,</if>
			<if test="sfpm != null  and sfpm != ''  ">sfpm,</if>
			<if test="delFlag != null  and delFlag != ''  ">del_flag,</if>
			<if test="createTime != null  ">create_time,</if>
			<if test="updateTime != null  ">update_time,</if>
			<if test="updateBy != null  and updateBy != ''  ">update_by,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="cgId != null  ">#{cgId},</if>
			<if test="ename != null  and ename != ''  ">#{ename},</if>
			<if test="jyyc != null  and jyyc != ''  ">#{jyyc},</if>
			<if test="xzcf != null  and xzcf != ''  ">#{xzcf},</if>
			<if test="hgxzcf != null  and hgxzcf != ''  ">#{hgxzcf},</if>
			<if test="yzwf != null  and yzwf != ''  ">#{yzwf},</if>
			<if test="gqcz != null  and gqcz != ''  ">#{gqcz},</if>
			<if test="qsgg != null  and qsgg != ''  ">#{qsgg},</if>
			<if test="qsxx != null  and qsxx != ''  ">#{qsxx},</if>
			<if test="dcdy != null  and dcdy != ''  ">#{dcdy},</if>
			<if test="cyjc != null  and cyjc != ''  ">#{cyjc},</if>
			<if test="msaj != null  and msaj != ''  ">#{msaj},</if>
			<if test="xzaj != null  and xzaj != ''  ">#{xzaj},</if>
			<if test="xsaj != null  and xsaj != ''  ">#{xsaj},</if>
			<if test="zxaj != null  and zxaj != ''  ">#{zxaj},</if>
			<if test="qzqsypc != null  and qzqsypc != ''  ">#{qzqsypc},</if>
			<if test="fsbqaj != null  and fsbqaj != ''  ">#{fsbqaj},</if>
			<if test="sxbzxr != null  and sxbzxr != ''  ">#{sxbzxr},</if>
			<if test="xzgxf != null  and xzgxf != ''  ">#{xzgxf},</if>
			<if test="sfxz != null  and sfxz != ''  ">#{sfxz},</if>
			<if test="sfpm != null  and sfpm != ''  ">#{sfpm},</if>
			<if test="delFlag != null  and delFlag != ''  ">#{delFlag},</if>
			<if test="createTime != null  ">#{createTime},</if>
			<if test="updateTime != null  ">#{updateTime},</if>
			<if test="updateBy != null  and updateBy != ''  ">#{updateBy},</if>
         </trim>
    </insert>
	 
    <update id="updateCreditGrantingRisk" parameterType="CreditGrantingRisk">
        update credit_granting_risk
        <trim prefix="SET" suffixOverrides=",">
            <if test="cgId != null  ">cg_id = #{cgId},</if>
            <if test="ename != null  and ename != ''  ">ename = #{ename},</if>
            <if test="jyyc != null  and jyyc != ''  ">jyyc = #{jyyc},</if>
            <if test="xzcf != null  and xzcf != ''  ">xzcf = #{xzcf},</if>
            <if test="hgxzcf != null  and hgxzcf != ''  ">hgxzcf = #{hgxzcf},</if>
            <if test="yzwf != null  and yzwf != ''  ">yzwf = #{yzwf},</if>
            <if test="gqcz != null  and gqcz != ''  ">gqcz = #{gqcz},</if>
            <if test="qsgg != null  and qsgg != ''  ">qsgg = #{qsgg},</if>
            <if test="qsxx != null  and qsxx != ''  ">qsxx = #{qsxx},</if>
            <if test="dcdy != null  and dcdy != ''  ">dcdy = #{dcdy},</if>
            <if test="cyjc != null  and cyjc != ''  ">cyjc = #{cyjc},</if>
            <if test="msaj != null  and msaj != ''  ">msaj = #{msaj},</if>
            <if test="xzaj != null  and xzaj != ''  ">xzaj = #{xzaj},</if>
            <if test="xsaj != null  and xsaj != ''  ">xsaj = #{xsaj},</if>
            <if test="zxaj != null  and zxaj != ''  ">zxaj = #{zxaj},</if>
            <if test="qzqsypc != null  and qzqsypc != ''  ">qzqsypc = #{qzqsypc},</if>
            <if test="fsbqaj != null  and fsbqaj != ''  ">fsbqaj = #{fsbqaj},</if>
            <if test="sxbzxr != null  and sxbzxr != ''  ">sxbzxr = #{sxbzxr},</if>
            <if test="xzgxf != null  and xzgxf != ''  ">xzgxf = #{xzgxf},</if>
            <if test="sfxz != null  and sfxz != ''  ">sfxz = #{sfxz},</if>
            <if test="sfpm != null  and sfpm != ''  ">sfpm = #{sfpm},</if>
            <if test="delFlag != null  and delFlag != ''  ">del_flag = #{delFlag},</if>
            <if test="createTime != null  ">create_time = #{createTime},</if>
            <if test="updateTime != null  ">update_time = #{updateTime},</if>
            <if test="updateBy != null  and updateBy != ''  ">update_by = #{updateBy},</if>
        </trim>
        where id = #{id}
    </update>

	<delete id="deleteCreditGrantingRiskById" parameterType="Long">
        delete from credit_granting_risk where id = #{id}
    </delete>
	
    <delete id="deleteCreditGrantingRiskByIds" parameterType="String">
        delete from credit_granting_risk where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>