<?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.ruoyi.project.zjsgfa.mapper.ClFxsbMapper">
    
    <resultMap type="ClFxsb" id="ClFxsbResult">
        <result property="id"    column="id"    />
        <result property="fxlb"    column="fxlb"    />
        <result property="fxys"    column="fxys"    />
        <result property="hgwh"    column="hgwh"    />
        <result property="fxms"    column="fxms"    />
        <result property="pdtj"    column="pdtj"    />
        <result property="gjcsmb"    column="gjcsmb"    />
        <result property="gcjscs"    column="gcjscs"    />
        <result property="zjycs"    column="zjycs"    />
        <result property="jkcs"    column="jkcs"    />
        <result property="glcs"    column="glcs"    />
        <result property="tsgj"    column="tsgj"    />
    </resultMap>

    <sql id="selectClFxsbVo">
        select id, fxlb, fxys, hgwh, fxms, pdtj, gjcsmb, gcjscs, zjycs, jkcs, glcs, tsgj from cl_fxsb
    </sql>

    <select id="selectClFxsbList" parameterType="ClFxsb" resultMap="ClFxsbResult">
        <include refid="selectClFxsbVo"/>
        <where>  
            <if test="fxlb != null  and fxlb != ''"> and fxlb = #{fxlb}</if>
            <if test="fxys != null  and fxys != ''"> and fxys = #{fxys}</if>
            <if test="hgwh != null  and hgwh != ''"> and hgwh = #{hgwh}</if>
            <if test="fxms != null  and fxms != ''"> and fxms = #{fxms}</if>
            <if test="pdtj != null  and pdtj != ''"> and pdtj = #{pdtj}</if>
            <if test="gjcsmb != null  and gjcsmb != ''"> and gjcsmb = #{gjcsmb}</if>
            <if test="gcjscs != null  and gcjscs != ''"> and gcjscs = #{gcjscs}</if>
            <if test="zjycs != null  and zjycs != ''"> and zjycs = #{zjycs}</if>
            <if test="jkcs != null  and jkcs != ''"> and jkcs = #{jkcs}</if>
            <if test="glcs != null  and glcs != ''"> and glcs = #{glcs}</if>
            <if test="tsgj != null  and tsgj != ''"> and tsgj = #{tsgj}</if>
        </where>
    </select>
    
    <select id="selectClFxsbById" parameterType="Long" resultMap="ClFxsbResult">
        <include refid="selectClFxsbVo"/>
        where id = #{id}
    </select>

    <insert id="insertClFxsb" parameterType="ClFxsb" useGeneratedKeys="true" keyProperty="id">
        insert into cl_fxsb
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fxlb != null">fxlb,</if>
            <if test="fxys != null">fxys,</if>
            <if test="hgwh != null">hgwh,</if>
            <if test="fxms != null">fxms,</if>
            <if test="pdtj != null">pdtj,</if>
            <if test="gjcsmb != null">gjcsmb,</if>
            <if test="gcjscs != null">gcjscs,</if>
            <if test="zjycs != null">zjycs,</if>
            <if test="jkcs != null">jkcs,</if>
            <if test="glcs != null">glcs,</if>
            <if test="tsgj != null">tsgj,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fxlb != null">#{fxlb},</if>
            <if test="fxys != null">#{fxys},</if>
            <if test="hgwh != null">#{hgwh},</if>
            <if test="fxms != null">#{fxms},</if>
            <if test="pdtj != null">#{pdtj},</if>
            <if test="gjcsmb != null">#{gjcsmb},</if>
            <if test="gcjscs != null">#{gcjscs},</if>
            <if test="zjycs != null">#{zjycs},</if>
            <if test="jkcs != null">#{jkcs},</if>
            <if test="glcs != null">#{glcs},</if>
            <if test="tsgj != null">#{tsgj},</if>
         </trim>
    </insert>

    <update id="updateClFxsb" parameterType="ClFxsb">
        update cl_fxsb
        <trim prefix="SET" suffixOverrides=",">
            <if test="fxlb != null">fxlb = #{fxlb},</if>
            <if test="fxys != null">fxys = #{fxys},</if>
            <if test="hgwh != null">hgwh = #{hgwh},</if>
            <if test="fxms != null">fxms = #{fxms},</if>
            <if test="pdtj != null">pdtj = #{pdtj},</if>
            <if test="gjcsmb != null">gjcsmb = #{gjcsmb},</if>
            <if test="gcjscs != null">gcjscs = #{gcjscs},</if>
            <if test="zjycs != null">zjycs = #{zjycs},</if>
            <if test="jkcs != null">jkcs = #{jkcs},</if>
            <if test="glcs != null">glcs = #{glcs},</if>
            <if test="tsgj != null">tsgj = #{tsgj},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteClFxsbById" parameterType="Long">
        delete from cl_fxsb where id = #{id}
    </delete>

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