<?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.mosty.base.manager.mapper.TbJcglKhbmMapper">
    <delete id="delKhbm">
        delete from tb_jcgl_khbm where ssbmid in
        <foreach collection="list" open="(" separator="," close=")" item="item">
            #{item}
        </foreach>
    </delete>

    <select id="getAllKhbm" resultType="java.lang.String">
        select ssbmid
        from tb_jcgl_khbm
        where xt_sjzt = '1'
          and xt_scbz = '0'
        <if test="ssbmdm != null and ssbmdm != ''">
            and ssbmdm like concat(#{ssbmdm},'%')
        </if>

    </select>

    <update id="editKhbm">
        update tb_jcgl_khbm
        <set>
            <if test="dto.ybb != null ">
                ybb = #{dto.ybb},
            </if>
            <if test="dto.ycr != null ">
                ycr = #{dto.ycr},
            </if>
            <if test="dto.ycc != null ">
                ycc = #{dto.ycc},
            </if>
            <if test="dto.yxlsc != null ">
                yxlsc = #{dto.yxlsc},
            </if>
            <if test="dto.yxllc != null ">
                yxllc = #{dto.yxllc},
            </if>
            <if test="dto.crf != null ">
                crf = #{dto.crf},
            </if>
            <if test="dto.ccf != null ">
                ccf = #{dto.ccf},
            </if>
            <if test="dto.cwf != null ">
                cwf = #{dto.cwf},
            </if>
            <if test="dto.ycw != null ">
                ycw = #{dto.ycw},
            </if>
            <if test="dto.yqs != null ">
                yqs = #{dto.yqs},
            </if>
            <if test="dto.qsf != null ">
                qsf = #{dto.qsf},
            </if>
            <if test="dto.xlscf != null ">
                xlscf = #{dto.xlscf},
            </if>
            <if test="dto.xllcf != null ">
                xllcf = #{dto.xllcf},
            </if>
            <if test="dto.yxl != null ">
                yxl = #{dto.yxl},
            </if>
            <if test="dto.xlf != null ">
                xlf = #{dto.xlf},
            </if>
            <if test="dto.bbf != null ">
                bbf = #{dto.bbf},
            </if>
            <if test="dto.mxmc != null and dto.mxmc != ''">
                mxmc = #{dto.mxmc}
            </if>
        </set>
        where id = #{dto.id}
    </update>
</mapper>