<?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.wzzx.mapper.TbWzXfwzMapper">

    <resultMap type="com.mosty.base.model.entity.wzzx.TbWzXfwz" id="TbWzXfwzMap">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="bbId" column="bb_id" jdbcType="VARCHAR"/>
        <result property="yhId" column="yh_id" jdbcType="VARCHAR"/>
        <result property="yhSfzh" column="yh_sfzh" jdbcType="VARCHAR"/>
        <result property="yhXm" column="yh_xm" jdbcType="VARCHAR"/>
        <result property="jzId" column="jz_id" jdbcType="VARCHAR"/>
        <result property="jzMc" column="jz_mc" jdbcType="VARCHAR"/>
        <result property="zb" column="zb" typeHandler="com.mosty.base.feign.handle.LineStringTypeHandler"/>
        <result property="zbsl" column="zbsl" jdbcType="INTEGER"/>
        <result property="dwrq" column="dwrq" jdbcType="TIMESTAMP"/>
        <result property="kssj" column="kssj" jdbcType="TIMESTAMP"/>
        <result property="jssj" column="jssj" jdbcType="TIMESTAMP"/>
        <result property="sc" column="sc" jdbcType="INTEGER"/>
        <result property="lc" column="lc" jdbcType="INTEGER"/>
        <result property="jd" column="jd" jdbcType="NUMERIC"/>
        <result property="wd" column="wd" jdbcType="NUMERIC"/>
        <result property="zhgxsj" column="zhgxsj" jdbcType="TIMESTAMP"/>
        <result property="ssbm" column="ssbm" jdbcType="VARCHAR"/>
        <result property="ssbmid" column="ssbmid" jdbcType="VARCHAR"/>
        <result property="ssbmdm" column="ssbmdm" jdbcType="VARCHAR"/>
        <result property="ssxgaj" column="ssxgaj" jdbcType="VARCHAR"/>
        <result property="ssxgajid" column="ssxgajid" jdbcType="VARCHAR"/>
        <result property="ssxgajdm" column="ssxgajdm" jdbcType="VARCHAR"/>
        <result property="sssgaj" column="sssgaj" jdbcType="VARCHAR"/>
        <result property="sssgajid" column="sssgajid" jdbcType="VARCHAR"/>
        <result property="sssgajdm" column="sssgajdm" jdbcType="VARCHAR"/>
        <result property="xtSjly" column="xt_sjly" jdbcType="VARCHAR"/>
        <result property="xtSjzt" column="xt_sjzt" jdbcType="VARCHAR"/>
        <result property="xtScbz" column="xt_scbz" jdbcType="VARCHAR"/>
        <result property="xtCjip" column="xt_cjip" jdbcType="VARCHAR"/>
        <result property="xtCjsj" column="xt_cjsj" jdbcType="TIMESTAMP"/>
        <result property="xtCjrId" column="xt_cjr_id" jdbcType="VARCHAR"/>
        <result property="xtCjr" column="xt_cjr" jdbcType="VARCHAR"/>
        <result property="xtCjbmdm" column="xt_cjbmdm" jdbcType="VARCHAR"/>
        <result property="xtCjbmmc" column="xt_cjbmmc" jdbcType="VARCHAR"/>
        <result property="xtZhgxip" column="xt_zhgxip" jdbcType="VARCHAR"/>
        <result property="xtZhgxsj" column="xt_zhgxsj" jdbcType="TIMESTAMP"/>
        <result property="xtZhgxrid" column="xt_zhgxrid" jdbcType="VARCHAR"/>
        <result property="xtZhgxr" column="xt_zhgxr" jdbcType="VARCHAR"/>
        <result property="xtZhgxbmdm" column="xt_zhgxbmdm" jdbcType="VARCHAR"/>
        <result property="xtZhgxbm" column="xt_zhgxbm" jdbcType="VARCHAR"/>
        <result property="bz" column="bz" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="base_column_list">
        id, bb_id, yh_id, yh_sfzh, yh_xm, jz_id, jz_mc,
       zbsl, dwrq, kssj, jssj, sc, lc, jd, wd, zhgxsj,
       ssbm, ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm,ssbmid,ssxgajid,sssgajid, xt_sjly, xt_sjzt, xt_scbz, xt_cjip,
       xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid,
       xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz
    </sql>

    <sql id="zb_sql">
        ST_ASWKT
        (zb) as zb
    </sql>

    <!--查询所有-->
    <select id="queryAll" resultMap="TbWzXfwzMap">
        select
        <include refid="base_column_list"/>,
        <include refid="zb_sql"/>
        from tb_wz_xfwz
        where xt_scbz = '0'
    </select>
    
    <!--查询单个-->
    <select id="queryById" resultMap="TbWzXfwzMap">
        select
        <include refid="base_column_list"/>,
        <include refid="zb_sql"/>
        from tb_wz_xfwz
        where xt_scbz = '0'
        and id = #{id}
    </select>

    <!--查询指定行数据-->
    <select id="queryAllByLimit" resultMap="TbWzXfwzMap">
        select
          id, bb_id, yh_id, yh_sfzh, yh_xm, jz_id, jz_mc, zb, zbsl, dwrq, kssj, jssj, sc, lc,
        ssbm, ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm,ssbmid,ssxgajid,sssgajid, xt_sjly, xt_sjzt, xt_scbz, xt_cjip,
        xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid,
        xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz
        from tb_wz_xfwz
        <where>
            <if test="id != null and id != ''">
                and id = #{id}
            </if>
            <if test="bbId != null and bbId != ''">
                and bb_id = #{bbId}
            </if>
            <if test="yhId != null and yhId != ''">
                and yh_id = #{yhId}
            </if>
            <if test="yhSfzh != null and yhSfzh != ''">
                and yh_sfzh = #{yhSfzh}
            </if>
            <if test="yhXm != null and yhXm != ''">
                and yh_xm = #{yhXm}
            </if>
            <if test="jzId != null and jzId != ''">
                and jz_id = #{jzId}
            </if>
            <if test="jzMc != null and jzMc != ''">
                and jz_mc = #{jzMc}
            </if>
            <if test="zb != null and zb != ''">
                and zb = #{zb}
            </if>
            <if test="zbsl != null">
                and zbsl = #{zbsl}
            </if>
            <if test="dwrq != null">
                and dwrq = #{dwrq}
            </if>
            <if test="kssj != null">
                and kssj = #{kssj}
            </if>
            <if test="jssj != null">
                and jssj = #{jssj}
            </if>
            <if test="sc != null">
                and sc = #{sc}
            </if>
            <if test="lc != null">
                and lc = #{lc}
            </if>
            <if test="ssbm != null and ssbm != ''">
                and ssbm = #{ssbm}
            </if>
            <if test="ssbmid != null and ssbmid != ''">
                and ssbmid = #{ssbmid}
            </if>
            <if test="ssbmdm != null and ssbmdm != ''">
                and ssbmdm = #{ssbmdm}
            </if>
            <if test="ssxgaj != null and ssxgaj != ''">
                and ssxgaj = #{ssxgaj}
            </if>
            <if test="ssxgajid != null and ssxgajid != ''">
                and ssxgajid = #{ssxgajid}
            </if>
            <if test="ssxgajdm != null and ssxgajdm != ''">
                and ssxgajdm = #{ssxgajdm}
            </if>
            <if test="sssgaj != null and sssgaj != ''">
                and sssgaj = #{sssgaj}
            </if>
            <if test="sssgajid != null and sssgajid != ''">
                and sssgajid = #{sssgajid}
            </if>
            <if test="sssgajdm != null and sssgajdm != ''">
                and sssgajdm = #{sssgajdm}
            </if>
            <if test="xtSjly != null and xtSjly != ''">
                and xt_sjly = #{xtSjly}
            </if>
            <if test="xtSjzt != null and xtSjzt != ''">
                and xt_sjzt = #{xtSjzt}
            </if>
            <if test="xtScbz != null and xtScbz != ''">
                and xt_scbz = #{xtScbz}
            </if>
            <if test="xtCjip != null and xtCjip != ''">
                and xt_cjip = #{xtCjip}
            </if>
            <if test="xtCjsj != null">
                and xt_cjsj = #{xtCjsj}
            </if>
            <if test="xtCjrId != null and xtCjrId != ''">
                and xt_cjr_id = #{xtCjrId}
            </if>
            <if test="xtCjr != null and xtCjr != ''">
                and xt_cjr = #{xtCjr}
            </if>
            <if test="xtCjbmdm != null and xtCjbmdm != ''">
                and xt_cjbmdm = #{xtCjbmdm}
            </if>
            <if test="xtCjbmmc != null and xtCjbmmc != ''">
                and xt_cjbmmc = #{xtCjbmmc}
            </if>
            <if test="xtZhgxip != null and xtZhgxip != ''">
                and xt_zhgxip = #{xtZhgxip}
            </if>
            <if test="xtZhgxsj != null">
                and xt_zhgxsj = #{xtZhgxsj}
            </if>
            <if test="xtZhgxrid != null and xtZhgxrid != ''">
                and xt_zhgxrid = #{xtZhgxrid}
            </if>
            <if test="xtZhgxr != null and xtZhgxr != ''">
                and xt_zhgxr = #{xtZhgxr}
            </if>
            <if test="xtZhgxbmdm != null and xtZhgxbmdm != ''">
                and xt_zhgxbmdm = #{xtZhgxbmdm}
            </if>
            <if test="xtZhgxbm != null and xtZhgxbm != ''">
                and xt_zhgxbm = #{xtZhgxbm}
            </if>
            <if test="bz != null and bz != ''">
                and bz = #{bz}
            </if>
        </where>
        limit #{pageable.offset}, #{pageable.pageSize}
    </select>

    <!--统计总行数-->
    <select id="count" resultType="java.lang.Long">
        select count(1)
        from tb_wz_xfwz
        <where>
            <if test="id != null and id != ''">
                and id = #{id}
            </if>
            <if test="bbId != null and bbId != ''">
                and bb_id = #{bbId}
            </if>
            <if test="yhId != null and yhId != ''">
                and yh_id = #{yhId}
            </if>
            <if test="yhSfzh != null and yhSfzh != ''">
                and yh_sfzh = #{yhSfzh}
            </if>
            <if test="yhXm != null and yhXm != ''">
                and yh_xm = #{yhXm}
            </if>
            <if test="jzId != null and jzId != ''">
                and jz_id = #{jzId}
            </if>
            <if test="jzMc != null and jzMc != ''">
                and jz_mc = #{jzMc}
            </if>
            <if test="zb != null and zb != ''">
                and zb = #{zb}
            </if>
            <if test="zbsl != null">
                and zbsl = #{zbsl}
            </if>
            <if test="dwrq != null">
                and dwrq = #{dwrq}
            </if>
            <if test="kssj != null">
                and kssj = #{kssj}
            </if>
            <if test="jssj != null">
                and jssj = #{jssj}
            </if>
            <if test="sc != null">
                and sc = #{sc}
            </if>
            <if test="lc != null">
                and lc = #{lc}
            </if>
            <if test="ssbm != null and ssbm != ''">
                and ssbm = #{ssbm}
            </if>
            <if test="ssbmid != null and ssbmid != ''">
                and ssbmid = #{ssbmid}
            </if>
            <if test="ssbmdm != null and ssbmdm != ''">
                and ssbmdm = #{ssbmdm}
            </if>
            <if test="ssxgaj != null and ssxgaj != ''">
                and ssxgaj = #{ssxgaj}
            </if>
            <if test="ssxgajid != null and ssxgajid != ''">
                and ssxgajid = #{ssxgajid}
            </if>
            <if test="ssxgajdm != null and ssxgajdm != ''">
                and ssxgajdm = #{ssxgajdm}
            </if>
            <if test="sssgaj != null and sssgaj != ''">
                and sssgaj = #{sssgaj}
            </if>
            <if test="sssgajid != null and sssgajid != ''">
                and sssgajid = #{sssgajid}
            </if>
            <if test="sssgajdm != null and sssgajdm != ''">
                and sssgajdm = #{sssgajdm}
            </if>
            <if test="xtSjly != null and xtSjly != ''">
                and xt_sjly = #{xtSjly}
            </if>
            <if test="xtSjzt != null and xtSjzt != ''">
                and xt_sjzt = #{xtSjzt}
            </if>
            <if test="xtScbz != null and xtScbz != ''">
                and xt_scbz = #{xtScbz}
            </if>
            <if test="xtCjip != null and xtCjip != ''">
                and xt_cjip = #{xtCjip}
            </if>
            <if test="xtCjsj != null">
                and xt_cjsj = #{xtCjsj}
            </if>
            <if test="xtCjrId != null and xtCjrId != ''">
                and xt_cjr_id = #{xtCjrId}
            </if>
            <if test="xtCjr != null and xtCjr != ''">
                and xt_cjr = #{xtCjr}
            </if>
            <if test="xtCjbmdm != null and xtCjbmdm != ''">
                and xt_cjbmdm = #{xtCjbmdm}
            </if>
            <if test="xtCjbmmc != null and xtCjbmmc != ''">
                and xt_cjbmmc = #{xtCjbmmc}
            </if>
            <if test="xtZhgxip != null and xtZhgxip != ''">
                and xt_zhgxip = #{xtZhgxip}
            </if>
            <if test="xtZhgxsj != null">
                and xt_zhgxsj = #{xtZhgxsj}
            </if>
            <if test="xtZhgxrid != null and xtZhgxrid != ''">
                and xt_zhgxrid = #{xtZhgxrid}
            </if>
            <if test="xtZhgxr != null and xtZhgxr != ''">
                and xt_zhgxr = #{xtZhgxr}
            </if>
            <if test="xtZhgxbmdm != null and xtZhgxbmdm != ''">
                and xt_zhgxbmdm = #{xtZhgxbmdm}
            </if>
            <if test="xtZhgxbm != null and xtZhgxbm != ''">
                and xt_zhgxbm = #{xtZhgxbm}
            </if>
            <if test="bz != null and bz != ''">
                and bz = #{bz}
            </if>
        </where>
    </select>

    <!--新增所有列-->
    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
        insert into tb_wz_xfwz(id, bb_id, yh_id, yh_sfzh, yh_xm, jz_id, jz_mc,
                               zb,
                               zbsl, dwrq, kssj, jssj, sc, lc, jd, wd, zhgxsj,ssbmid,ssxgajid,sssgajid,
                               ssbm, ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm, xt_sjly, xt_sjzt, xt_scbz, xt_cjip,
                               xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid,
                               xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz)
        values (#{id}, #{bbId}, #{yhId}, #{yhSfzh}, #{yhXm}, #{jzId}, #{jzMc},
                ST_GEOMFROMTEXT(#{zb,typeHandler = com.mosty.base.feign.handle.LineStringTypeHandler}),
                #{zbsl}, #{dwrq}, #{kssj}, #{jssj}, #{sc}, #{lc},  #{jd}, #{wd}, #{zhgxsj},#{ssbmid},#{ssxgajid},#{sssgajid},
                #{ssbm}, #{ssbmdm}, #{ssxgaj}, #{ssxgajdm}, #{sssgaj}, #{sssgajdm}, #{xtSjly}, #{xtSjzt}, #{xtScbz},
                #{xtCjip}, #{xtCjsj}, #{xtCjrId}, #{xtCjr}, #{xtCjbmdm}, #{xtCjbmmc}, #{xtZhgxip}, #{xtZhgxsj},
                #{xtZhgxrid}, #{xtZhgxr}, #{xtZhgxbmdm}, #{xtZhgxbm}, #{bz})
    </insert>

    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
        insert into tb_wz_xfwz(bb_id, yh_id, yh_sfzh, yh_xm, jz_id, jz_mc, zb, zbsl, dwrq, kssj, jssj, sc, lc, jd, wd, zhgxsj, ssbm,
        ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm, xt_sjly, xt_sjzt, xt_scbz, xt_cjip, xt_cjsj, xt_cjr_id, xt_cjr,
        xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid, xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz)
        values
        <foreach collection="entities" item="entity" separator=",">
        (#{entity.bbId}, #{entity.yhId}, #{entity.yhSfzh}, #{entity.yhXm}, #{entity.jzId}, #{entity.jzMc},
            #{entity.zb}, #{entity.zbsl}, #{entity.dwrq}, #{entity.kssj}, #{entity.jssj}, #{entity.sc}, #{entity.lc},
            #{jd}, #{wd}, #{zhgxsj}, #{entity.ssbm}, #{entity.ssbmdm}, #{entity.ssxgaj}, #{entity.ssxgajdm},
            #{entity.sssgaj}, #{entity.sssgajdm}, #{entity.xtSjly}, #{entity.xtSjzt}, #{entity.xtScbz}, #{entity.xtCjip}, #{entity.xtCjsj}, #{entity.xtCjrId}, #{entity.xtCjr}, #{entity.xtCjbmdm}, #{entity.xtCjbmmc}, #{entity.xtZhgxip}, #{entity.xtZhgxsj}, #{entity.xtZhgxrid}, #{entity.xtZhgxr}, #{entity.xtZhgxbmdm}, #{entity.xtZhgxbm}, #{entity.bz})
        </foreach>
    </insert>

    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into tb_wz_xfwz(bb_id, yh_id, yh_sfzh, yh_xm, jz_id, jz_mc, zb, zbsl, dwrq, kssj, jssj, sc, lc,  jd, wd, zhgxsj,
                               ssbm, ssbmdm, ssxgaj, ssxgajdm, sssgaj, sssgajdm, xt_sjly, xt_sjzt, xt_scbz, xt_cjip,
        xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid, xt_zhgxr, xt_zhgxbmdm,
        xt_zhgxbm, bz)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.bbId}, #{entity.yhId}, #{entity.yhSfzh}, #{entity.yhXm}, #{entity.jzId}, #{entity.jzMc},
             #{entity.zb}, #{entity.zbsl}, #{entity.dwrq}, #{entity.kssj}, #{entity.jssj}, #{entity.sc},
             #{entity.lc},  #{jd}, #{wd}, #{zhgxsj},
             #{entity.ssbm}, #{entity.ssbmdm}, #{entity.ssxgaj}, #{entity.ssxgajdm}, #{entity.sssgaj},
            #{entity.sssgajdm}, #{entity.xtSjly}, #{entity.xtSjzt}, #{entity.xtScbz}, #{entity.xtCjip},
            #{entity.xtCjsj}, #{entity.xtCjrId}, #{entity.xtCjr}, #{entity.xtCjbmdm}, #{entity.xtCjbmmc}, #{entity.xtZhgxip}, #{entity.xtZhgxsj}, #{entity.xtZhgxrid}, #{entity.xtZhgxr}, #{entity.xtZhgxbmdm}, #{entity.xtZhgxbm}, #{entity.bz})
        </foreach>
        on duplicate key update
        bb_id = values(bb_id),
        yh_id = values(yh_id),
        yh_sfzh = values(yh_sfzh),
        yh_xm = values(yh_xm),
        jz_id = values(jz_id),
        jz_mc = values(jz_mc),
        zb = values(zb),
        zbsl = values(zbsl),
        dwrq = values(dwrq),
        kssj = values(kssj),
        jssj = values(jssj),
        sc = values(sc),
        lc = values(lc),
        jd = values(jd),
        wd = values(wd),
        zhgxsj = values(zhgxsj),
        ssbm = values(ssbm),
        ssbmdm = values(ssbmdm),
        ssxgaj = values(ssxgaj),
        ssxgajdm = values(ssxgajdm),
        sssgaj = values(sssgaj),
        sssgajdm = values(sssgajdm),
        xt_sjly = values(xt_sjly),
        xt_sjzt = values(xt_sjzt),
        xt_scbz = values(xt_scbz),
        xt_cjip = values(xt_cjip),
        xt_cjsj = values(xt_cjsj),
        xt_cjr_id = values(xt_cjr_id),
        xt_cjr = values(xt_cjr),
        xt_cjbmdm = values(xt_cjbmdm),
        xt_cjbmmc = values(xt_cjbmmc),
        xt_zhgxip = values(xt_zhgxip),
        xt_zhgxsj = values(xt_zhgxsj),
        xt_zhgxrid = values(xt_zhgxrid),
        xt_zhgxr = values(xt_zhgxr),
        xt_zhgxbmdm = values(xt_zhgxbmdm),
        xt_zhgxbm = values(xt_zhgxbm),
        bz = values(bz)
    </insert>

    <!--通过主键修改数据-->
    <update id="update">
        update tb_wz_xfwz
        <set>
            <if test="bbId != null and bbId != ''">
                bb_id = #{bbId},
            </if>
            <if test="yhId != null and yhId != ''">
                yh_id = #{yhId},
            </if>
            <if test="yhSfzh != null and yhSfzh != ''">
                yh_sfzh = #{yhSfzh},
            </if>
            <if test="yhXm != null and yhXm != ''">
                yh_xm = #{yhXm},
            </if>
            <if test="jzId != null and jzId != ''">
                jz_id = #{jzId},
            </if>
            <if test="jzMc != null and jzMc != ''">
                jz_mc = #{jzMc},
            </if>
            <if test="zb != null">
                zb = ST_GEOMFROMTEXT(#{zb,typeHandler = com.mosty.base.feign.handle.LineStringTypeHandler}),
            </if>
            <if test="zbsl != null">
                zbsl = #{zbsl},
            </if>
            <if test="dwrq != null">
                dwrq = #{dwrq},
            </if>
            <if test="kssj != null">
                kssj = #{kssj},
            </if>
            <if test="jssj != null">
                jssj = #{jssj},
            </if>
            <if test="sc != null">
                sc = #{sc},
            </if>
            <if test="lc != null">
                lc = #{lc},
            </if>
            <if test="jd != null and jd != ''">
                jd = #{jd},
            </if>
            <if test="wd != null and wd != ''">
                wd = #{wd},
            </if>
            <if test="zhgxsj != null">
                zhgxsj = #{zhgxsj},
            </if>
            <if test="ssbm != null and ssbm != ''">
                ssbm = #{ssbm},
            </if>
            <if test="ssbmdm != null and ssbmdm != ''">
                ssbmdm = #{ssbmdm},
            </if>
            <if test="ssxgaj != null and ssxgaj != ''">
                ssxgaj = #{ssxgaj},
            </if>
            <if test="ssxgajdm != null and ssxgajdm != ''">
                ssxgajdm = #{ssxgajdm},
            </if>
            <if test="sssgaj != null and sssgaj != ''">
                sssgaj = #{sssgaj},
            </if>
            <if test="sssgajdm != null and sssgajdm != ''">
                sssgajdm = #{sssgajdm},
            </if>
            <if test="xtSjly != null and xtSjly != ''">
                xt_sjly = #{xtSjly},
            </if>
            <if test="xtSjzt != null and xtSjzt != ''">
                xt_sjzt = #{xtSjzt},
            </if>
            <if test="xtScbz != null and xtScbz != ''">
                xt_scbz = #{xtScbz},
            </if>
            <if test="xtCjip != null and xtCjip != ''">
                xt_cjip = #{xtCjip},
            </if>
            <if test="xtCjsj != null">
                xt_cjsj = #{xtCjsj},
            </if>
            <if test="xtCjrId != null and xtCjrId != ''">
                xt_cjr_id = #{xtCjrId},
            </if>
            <if test="xtCjr != null and xtCjr != ''">
                xt_cjr = #{xtCjr},
            </if>
            <if test="xtCjbmdm != null and xtCjbmdm != ''">
                xt_cjbmdm = #{xtCjbmdm},
            </if>
            <if test="xtCjbmmc != null and xtCjbmmc != ''">
                xt_cjbmmc = #{xtCjbmmc},
            </if>
            <if test="xtZhgxip != null and xtZhgxip != ''">
                xt_zhgxip = #{xtZhgxip},
            </if>
            <if test="xtZhgxsj != null">
                xt_zhgxsj = #{xtZhgxsj},
            </if>
            <if test="xtZhgxrid != null and xtZhgxrid != ''">
                xt_zhgxrid = #{xtZhgxrid},
            </if>
            <if test="xtZhgxr != null and xtZhgxr != ''">
                xt_zhgxr = #{xtZhgxr},
            </if>
            <if test="xtZhgxbmdm != null and xtZhgxbmdm != ''">
                xt_zhgxbmdm = #{xtZhgxbmdm},
            </if>
            <if test="xtZhgxbm != null and xtZhgxbm != ''">
                xt_zhgxbm = #{xtZhgxbm},
            </if>
            <if test="bz != null and bz != ''">
                bz = #{bz},
            </if>
        </set>
        where id = #{id}
    </update>

    <!--通过主键删除-->
    <delete id="deleteById">
        delete from tb_wz_xfwz where id = #{id}
    </delete>

    <select id="queryByBbid" resultMap="TbWzXfwzMap">
        select
        <include refid="base_column_list"/>,
        <include refid="zb_sql"/>
        from tb_wz_xfwz
        where xt_scbz = '0'
        and bb_id = #{bbid,jdbcType=VARCHAR}  limit 1
    </select>

</mapper>


