SifaSsdwDictMapper.xml 3.01 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.sifaSsdwDict.mapper.SifaSsdwDictMapper">
    
    <resultMap type="SifaSsdwDict" id="SifaSsdwDictResult">
        <result property="id"    column="id"    />
        <result property="ajlx"    column="ajlx"    />
        <result property="sljd"    column="sljd"    />
        <result property="yz"    column="yz"    />
        <result property="tjfl"    column="tjfl"    />
    </resultMap>
	
	<sql id="selectSifaSsdwDictVo">
        select id, ajlx, sljd, yz, tjfl from sifa_ssdw_dict
    </sql>
	
    <select id="selectSifaSsdwDictList" parameterType="SifaSsdwDict" resultMap="SifaSsdwDictResult">
        <include refid="selectSifaSsdwDictVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="ajlx != null  and ajlx != '' "> and ajlx = #{ajlx}</if>
            <if test="sljd != null  and sljd != '' "> and sljd = #{sljd}</if>
            <if test="yz != null  and yz != '' "> and yz = #{yz}</if>
            <if test="tjfl != null  and tjfl != '' "> and tjfl = #{tjfl}</if>
        </where>
    </select>
    
    <select id="selectSifaSsdwDictById" parameterType="Integer" resultMap="SifaSsdwDictResult">
        <include refid="selectSifaSsdwDictVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertSifaSsdwDict" parameterType="SifaSsdwDict" useGeneratedKeys="true" keyProperty="id">
        insert into sifa_ssdw_dict
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="ajlx != null  and ajlx != ''  ">ajlx,</if>
			<if test="sljd != null  and sljd != ''  ">sljd,</if>
			<if test="yz != null  and yz != ''  ">yz,</if>
			<if test="tjfl != null  and tjfl != ''  ">tjfl,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="ajlx != null  and ajlx != ''  ">#{ajlx},</if>
			<if test="sljd != null  and sljd != ''  ">#{sljd},</if>
			<if test="yz != null  and yz != ''  ">#{yz},</if>
			<if test="tjfl != null  and tjfl != ''  ">#{tjfl},</if>
         </trim>
    </insert>
	 
    <update id="updateSifaSsdwDict" parameterType="SifaSsdwDict">
        update sifa_ssdw_dict
        <trim prefix="SET" suffixOverrides=",">
            <if test="ajlx != null  and ajlx != ''  ">ajlx = #{ajlx},</if>
            <if test="sljd != null  and sljd != ''  ">sljd = #{sljd},</if>
            <if test="yz != null  and yz != ''  ">yz = #{yz},</if>
            <if test="tjfl != null  and tjfl != ''  ">tjfl = #{tjfl},</if>
        </trim>
        where id = #{id}
    </update>

	<delete id="deleteSifaSsdwDictById" parameterType="Integer">
        delete from sifa_ssdw_dict where id = #{id}
    </delete>
	
    <delete id="deleteSifaSsdwDictByIds" parameterType="String">
        delete from sifa_ssdw_dict where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>