<?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.TbJcglXfwgMapper">
    <!--批量删除-->
    <delete id="deleteBatch">
        delete from tb_jcgl_xfwg where id in
        <foreach collection="list" item="item" separator="," open="(" close=")">
            #{item}
        </foreach>
    </delete>

    <insert id="insertEntity">
        insert into tb_jcgl_xfwg(
            id,wg_mc,wg_bh,wglx,wg_mj,ss_xfqy_id,wg_tp,
            pgis,
            xzqhdm,ssbm,ssbmid,ssbmdm,ssxgajid,ssxgaj,ssxgajdm,sssgajid,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},#{wgMc},#{wgBh},#{wglx},#{wgMj},#{ssXfqyId},#{wgTp},
            ST_GEOMFROMTEXT(#{pgis,typeHandler = com.mosty.base.feign.handle.LineStringTypeHandler}),
            #{xzqhdm},#{ssbm},#{ssbmid},#{ssbmdm},#{ssxgajid},#{ssxgaj},#{ssxgajdm},#{sssgajid},#{sssgaj},#{sssgajdm},
            #{xtSjly},#{xtSjzt},#{xtScbz},#{xtCjip},#{xtCjsj},#{xtCjrId},#{xtCjr},#{xtCjbmdm},#{xtCjbmmc},
            #{xtZhgxip},#{xtZhgxsj},#{xtZhgxrid},#{xtZhgxr},#{xtZhgxbmdm},#{xtZhgxbm},#{bz}
        )
    </insert>

    <update id="updateEntity">
        update tb_jcgl_xfwg
        <set>
            <if test="wgMc != null and wgMc != ''">
                wg_mc = #{wgMc},
            </if>
            <if test="wgBh != null and wgBh != ''">
                wg_bh = #{wgBh},
            </if>
            <if test="wglx != null and wglx != ''">
                wglx = #{wglx},
            </if>
            <if test="wgMj != null">
                wg_mj = #{wgMj},
            </if>
            <if test="pgis != null">
                pgis = ST_GEOMFROMTEXT(#{pgis,typeHandler = com.mosty.base.feign.handle.LineStringTypeHandler}),
            </if>
            <if test="ssXfqyId != null and ssXfqyId != ''">
                ss_xfqy_id = #{ssXfqyId},
            </if>
            <if test="wgTp != null and wgTp != ''">
                wg_tp = #{wgTp},
            </if>
            <if test="xzqhdm != null and xzqhdm != ''">
                xzqhdm = #{xzqhdm},
            </if>
            <if test="ssbmid != null and ssbmid != ''">
                ssbmid = #{ssbmid},
            </if>
            <if test="ssxgajid != null and ssxgajid != ''">
                ssxgajid = #{ssxgajid},
            </if>
            <if test="sssgajid != null and sssgajid != ''">
                sssgajid = #{sssgajid},
            </if>
            <if test="ssbmdm != null and ssbmdm != ''">
                ssbmdm = #{ssbmdm},
            </if>
            <if test="ssbm != null and ssbm != ''">
                ssbm = #{ssbm},
            </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>
</mapper>
