JycountMapper.xml 4.92 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.jycount.mapper.JycountMapper">
    
    <resultMap type="Jycount" id="JycountResult">
        <result property="id"    column="id"    />
        <result property="jyyc"    column="jyyc"    />
        <result property="xzcf"    column="xzcf"    />
        <result property="yzwf"    column="yzwf"    />
        <result property="gqcz"    column="gqcz"    />
        <result property="gqdj"    column="gqdj"    />
        <result property="qsgg"    column="qsgg"    />
        <result property="qsxx"    column="qsxx"    />
        <result property="dcdy"    column="dcdy"    />
        <result property="tddy"    column="tddy"    />
        <result property="ccjc"    column="ccjc"    />
        <result property="status"    column="status"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>
	
	<sql id="selectJycountVo">
        select id, jyyc, xzcf, yzwf, gqcz, gqdj, qsgg, qsxx, dcdy, tddy, ccjc, status, create_time from jycount
    </sql>
	
    <select id="selectJycountList" parameterType="Jycount" resultMap="JycountResult">
        <include refid="selectJycountVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="jyyc != null "> and jyyc = #{jyyc}</if>
            <if test="xzcf != null "> and xzcf = #{xzcf}</if>
            <if test="yzwf != null "> and yzwf = #{yzwf}</if>
            <if test="gqcz != null "> and gqcz = #{gqcz}</if>
            <if test="gqdj != null "> and gqdj = #{gqdj}</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="tddy != null "> and tddy = #{tddy}</if>
            <if test="ccjc != null "> and ccjc = #{ccjc}</if>
            <if test="status != null  and status != '' "> and status = #{status}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
        </where>
    </select>
    
    <select id="selectJycountById" parameterType="Long" resultMap="JycountResult">
        <include refid="selectJycountVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertJycount" parameterType="Jycount" useGeneratedKeys="true" keyProperty="id">
        insert into jycount
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="jyyc != null  ">jyyc,</if>
			<if test="xzcf != null  ">xzcf,</if>
			<if test="yzwf != null  ">yzwf,</if>
			<if test="gqcz != null  ">gqcz,</if>
			<if test="gqdj != null  ">gqdj,</if>
			<if test="qsgg != null  ">qsgg,</if>
			<if test="qsxx != null  ">qsxx,</if>
			<if test="dcdy != null  ">dcdy,</if>
			<if test="tddy != null  ">tddy,</if>
			<if test="ccjc != null  ">ccjc,</if>
			<if test="status != null  and status != ''  ">status,</if>
			<if test="createTime != null  ">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="jyyc != null  ">#{jyyc},</if>
			<if test="xzcf != null  ">#{xzcf},</if>
			<if test="yzwf != null  ">#{yzwf},</if>
			<if test="gqcz != null  ">#{gqcz},</if>
			<if test="gqdj != null  ">#{gqdj},</if>
			<if test="qsgg != null  ">#{qsgg},</if>
			<if test="qsxx != null  ">#{qsxx},</if>
			<if test="dcdy != null  ">#{dcdy},</if>
			<if test="tddy != null  ">#{tddy},</if>
			<if test="ccjc != null  ">#{ccjc},</if>
			<if test="status != null  and status != ''  ">#{status},</if>
			<if test="createTime != null  ">#{createTime},</if>
         </trim>
    </insert>
	 
    <update id="updateJycount" parameterType="Jycount">
        update jycount
        <trim prefix="SET" suffixOverrides=",">
            <if test="jyyc != null  ">jyyc = #{jyyc},</if>
            <if test="xzcf != null  ">xzcf = #{xzcf},</if>
            <if test="yzwf != null  ">yzwf = #{yzwf},</if>
            <if test="gqcz != null  ">gqcz = #{gqcz},</if>
            <if test="gqdj != null  ">gqdj = #{gqdj},</if>
            <if test="qsgg != null  ">qsgg = #{qsgg},</if>
            <if test="qsxx != null  ">qsxx = #{qsxx},</if>
            <if test="dcdy != null  ">dcdy = #{dcdy},</if>
            <if test="tddy != null  ">tddy = #{tddy},</if>
            <if test="ccjc != null  ">ccjc = #{ccjc},</if>
            <if test="status != null  and status != ''  ">status = #{status},</if>
            <if test="createTime != null  ">create_time = #{createTime},</if>
        </trim>
        where id = #{id}
    </update>

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