SfcountMapper.xml 5.34 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.sfcount.mapper.SfcountMapper">
    
    <resultMap type="Sfcount" id="SfcountResult">
        <result property="id"    column="id"    />
        <result property="ms"    column="ms"    />
        <result property="xs"    column="xs"    />
        <result property="xz"    column="xz"    />
        <result property="fsbq"    column="fsbq"    />
        <result property="zx"    column="zx"    />
        <result property="pc"    column="pc"    />
        <result property="yg"    column="yg"    />
        <result property="bg"    column="bg"    />
        <result property="dsr"    column="dsr"    />
        <result property="yja"    column="yja"    />
        <result property="wja"    column="wja"    />
        <result property="ay"    column="ay"    />
        <result property="status"    column="status"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>
	
	<sql id="selectSfcountVo">
        select id, ms, xs, xz, fsbq, zx, pc, yg, bg, dsr, yja, wja, ay, status, create_time from sfcount
    </sql>
	
    <select id="selectSfcountList" parameterType="Sfcount" resultMap="SfcountResult">
        <include refid="selectSfcountVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="ms != null "> and ms = #{ms}</if>
            <if test="xs != null "> and xs = #{xs}</if>
            <if test="xz != null "> and xz = #{xz}</if>
            <if test="fsbq != null "> and fsbq = #{fsbq}</if>
            <if test="zx != null "> and zx = #{zx}</if>
            <if test="pc != null "> and pc = #{pc}</if>
            <if test="yg != null "> and yg = #{yg}</if>
            <if test="bg != null "> and bg = #{bg}</if>
            <if test="dsr != null "> and dsr = #{dsr}</if>
            <if test="yja != null "> and yja = #{yja}</if>
            <if test="wja != null "> and wja = #{wja}</if>
            <if test="ay != null  and ay != '' "> and ay = #{ay}</if>
            <if test="status != null  and status != '' "> and status = #{status}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
        </where>
    </select>
    
    <select id="selectSfcountById" parameterType="Long" resultMap="SfcountResult">
        <include refid="selectSfcountVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertSfcount" parameterType="Sfcount" useGeneratedKeys="true" keyProperty="id">
        insert into sfcount
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="ms != null  ">ms,</if>
			<if test="xs != null  ">xs,</if>
			<if test="xz != null  ">xz,</if>
			<if test="fsbq != null  ">fsbq,</if>
			<if test="zx != null  ">zx,</if>
			<if test="pc != null  ">pc,</if>
			<if test="yg != null  ">yg,</if>
			<if test="bg != null  ">bg,</if>
			<if test="dsr != null  ">dsr,</if>
			<if test="yja != null  ">yja,</if>
			<if test="wja != null  ">wja,</if>
			<if test="ay != null  and ay != ''  ">ay,</if>
			<if test="status != null  and status != ''  ">status,</if>
			<if test="createTime != null  ">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="ms != null  ">#{ms},</if>
			<if test="xs != null  ">#{xs},</if>
			<if test="xz != null  ">#{xz},</if>
			<if test="fsbq != null  ">#{fsbq},</if>
			<if test="zx != null  ">#{zx},</if>
			<if test="pc != null  ">#{pc},</if>
			<if test="yg != null  ">#{yg},</if>
			<if test="bg != null  ">#{bg},</if>
			<if test="dsr != null  ">#{dsr},</if>
			<if test="yja != null  ">#{yja},</if>
			<if test="wja != null  ">#{wja},</if>
			<if test="ay != null  and ay != ''  ">#{ay},</if>
			<if test="status != null  and status != ''  ">#{status},</if>
			<if test="createTime != null  ">#{createTime},</if>
         </trim>
    </insert>
	 
    <update id="updateSfcount" parameterType="Sfcount">
        update sfcount
        <trim prefix="SET" suffixOverrides=",">
            <if test="ms != null  ">ms = #{ms},</if>
            <if test="xs != null  ">xs = #{xs},</if>
            <if test="xz != null  ">xz = #{xz},</if>
            <if test="fsbq != null  ">fsbq = #{fsbq},</if>
            <if test="zx != null  ">zx = #{zx},</if>
            <if test="pc != null  ">pc = #{pc},</if>
            <if test="yg != null  ">yg = #{yg},</if>
            <if test="bg != null  ">bg = #{bg},</if>
            <if test="dsr != null  ">dsr = #{dsr},</if>
            <if test="yja != null  ">yja = #{yja},</if>
            <if test="wja != null  ">wja = #{wja},</if>
            <if test="ay != null  and ay != ''  ">ay = #{ay},</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="deleteSfcountById" parameterType="Long">
        delete from sfcount where id = #{id}
    </delete>
	
    <delete id="deleteSfcountByIds" parameterType="String">
        delete from sfcount where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

    <update id="updateSfcountStatus">
        update sfcount set status='1'
    </update>
    
</mapper>