<?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.yjzl.mapper.TbZlRgMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mosty.base.model.entity.yjzl.TbZlRg">
        <id column="id" property="id" jdbcType="VARCHAR"/>
        <result column="zl_id" property="zlId" jdbcType="VARCHAR"/>
        <result column="yw_id" property="ywId" jdbcType="VARCHAR"/>
        <result column="zllx" property="zllx" jdbcType="VARCHAR"/>
        <result column="zlbt" property="zlbt" jdbcType="VARCHAR"/>
        <result column="zlnr" property="zlnr" jdbcType="VARCHAR"/>
        <result column="zlzxqk" property="zlzxqk" jdbcType="VARCHAR"/>
        <result column="zlfqrq" property="zlfqrq" jdbcType="TIMESTAMP"/>
        <result column="zlfqsj" property="zlfqsj" jdbcType="TIMESTAMP"/>
        <result column="zldj" property="zldj" jdbcType="VARCHAR"/>
        <result column="zljsdx" property="zljsdx" jdbcType="VARCHAR"/>
        <result column="qsyxsj" property="qsyxsj" jdbcType="TIMESTAMP"/>
        <result column="qssj" property="qssj" jdbcType="TIMESTAMP"/>
        <result column="qszt" property="qszt" jdbcType="VARCHAR"/>
        <result column="ddxcyxsj" property="ddxcyxsj" jdbcType="TIMESTAMP"/>
        <result column="ddxcsj" property="ddxcsj" jdbcType="TIMESTAMP"/>
        <result column="ddxczt" property="ddxczt" jdbcType="VARCHAR"/>
        <result column="zlwjyxsj" property="zlwjyxsj" jdbcType="TIMESTAMP"/>
        <result column="zlwjsj" property="zlwjsj" jdbcType="TIMESTAMP"/>
        <result column="zlwjsm" property="zlwjsm" jdbcType="VARCHAR"/>
        <result column="zlwjzt" property="zlwjzt" jdbcType="VARCHAR"/>
        <result column="zlzxzt" property="zlzxzt" jdbcType="VARCHAR"/>
        <result column="jd" property="jd" jdbcType="NUMERIC"/>
        <result column="wd" property="wd" jdbcType="NUMERIC"/>
        <result column="zb" property="zb" typeHandler="com.mosty.base.feign.handle.PointTypeHandler"/>
        <result column="zbhash" property="zbhash" jdbcType="VARCHAR"/>
        <result column="zlfsddxzqh" property="zlfsddxzqh" jdbcType="VARCHAR"/>
        <result column="zlfsdd" property="zlfsdd" jdbcType="VARCHAR"/>
        <result column="zlfqr_id" property="zlfqrId" jdbcType="VARCHAR"/>
        <result column="zlfqr" property="zlfqr" jdbcType="VARCHAR"/>
        <result column="zlfqr_sfzh" property="zlfqrSfzh" jdbcType="VARCHAR"/>
        <result column="zlfqr_dh" property="zlfqrDh" jdbcType="VARCHAR"/>
        <result column="fj_id" property="fjId" jdbcType="VARCHAR"/>
        <result column="zljsrs" property="zljsrs" jdbcType="NUMERIC"/>
        <result column="zltp" property="zltp" jdbcType="VARCHAR"/>
        <result column="ssbm" property="ssbm" jdbcType="VARCHAR"/>
        <result column="ssbmdm" property="ssbmdm" jdbcType="VARCHAR"/>
        <result column="ssbmid" property="ssbmid" jdbcType="VARCHAR"/>
        <result column="ssxgaj" property="ssxgaj" jdbcType="VARCHAR"/>
        <result column="ssxgajdm" property="ssxgajdm" jdbcType="VARCHAR"/>
        <result column="ssxgajid" property="ssxgajid" jdbcType="VARCHAR"/>
        <result column="sssgaj" property="sssgaj" jdbcType="VARCHAR"/>
        <result column="sssgajdm" property="sssgajdm" jdbcType="VARCHAR"/>
        <result column="sssgajid" property="sssgajid" 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>

    <!-- 通用查询结果列 无zb -->
    <sql id="base_column_list">
        id,zl_id,yw_id,zllx,zlbt,zlnr,zlzxqk,zlfqrq,zlfqsj,zldj,zljsdx,qsyxsj,qssj,qszt,ddxcyxsj,ddxcsj,ddxczt,
        zlwjyxsj,zlwjsj,zlwjsm,zlwjzt,zlzxzt,jd,wd,zb,zbhash,zlfsddxzqh,zlfsdd,zlfqr_id,zlfqr,zlfqr_sfzh,
        zlfqr_dh,fj_id,zljsrs,zltp,ssbm,ssbmdm,ssbmid,ssxgaj,ssxgajdm,ssxgajid,sssgaj,sssgajdm,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>

    <!-- 通用查询结果列 无zb -->
    <sql id="base_column_list_nozb">
        id,zl_id,yw_id,zllx,zlbt,zlnr,zlzxqk,zlfqrq,zlfqsj,zldj,zljsdx,qsyxsj,qssj,qszt,ddxcyxsj,ddxcsj,ddxczt,
        zlwjyxsj,zlwjsj,zlwjsm,zlwjzt,zlzxzt,jd,wd,zbhash,zlfsddxzqh,zlfsdd,zlfqr_id,zlfqr,zlfqr_sfzh,
        zlfqr_dh,fj_id,zljsrs,zltp,ssbm,ssbmdm,ssbmid,ssxgaj,ssxgajdm,ssxgajid,sssgaj,sssgajdm,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>

    <insert id="insertEntity" parameterType="com.mosty.base.model.entity.yjzl.TbZlRg">
        insert into tb_zl_rg(<include refid="base_column_list"/>)
        values (
            #{id},#{zlId},#{ywId},#{zllx},#{zlbt},#{zlnr},#{zlzxqk},#{zlfqrq},#{zlfqsj},#{zldj},#{zljsdx},#{qsyxsj},
        #{qssj},#{qszt},#{ddxcyxsj},#{ddxcsj},#{ddxczt},#{zlwjyxsj},#{zlwjsj},#{zlwjsm},#{zlwjzt},#{zlzxzt},#{jd},#{wd},
        ST_GEOMFROMTEXT(#{zb, typeHandler = com.mosty.base.feign.handle.PointTypeHandler}),
        #{zbhash},#{zlfsddxzqh},#{zlfsdd},#{zlfqrId},#{zlfqr},#{zlfqrSfzh},#{zlfqrDh},#{fjId},#{zljsrs},#{zltp},
        #{ssbm},#{ssbmdm},#{ssbmid},#{ssxgaj},#{ssxgajdm},#{ssxgajid},#{sssgaj},#{sssgajdm},#{sssgajid},#{xtSjly},
        #{xtSjzt}, #{xtScbz},#{xtCjip}, #{xtCjsj}, #{xtCjrId}, #{xtCjr}, #{xtCjbmdm}, #{xtCjbmmc}, #{xtZhgxip}, #{xtZhgxsj},
        #{xtZhgxrid},#{xtZhgxr}, #{xtZhgxbmdm}, #{xtZhgxbm}, #{bz}
        )
    </insert>

    <update id="updateEntity" parameterType="com.mosty.base.model.entity.yjzl.TbZlRg">
        update tb_zl_rg
        <set>
            <if test="zlId != null and zlId != ''">
                zl_id = #{zlId},
            </if>
            <if test="ywId != null and ywId != ''">
                yw_id = #{ywId},
            </if>
            <if test="zllx != null and zllx != ''">
                zllx = #{zllx},
            </if>
            <if test="zlbt != null and zlbt != ''">
                zlbt = #{zlbt},
            </if>
            <if test="zlnr != null and zlnr != ''">
                zlnr = #{zlnr},
            </if>
            <if test="zlzxqk != null and zlzxqk != ''">
                zlzxqk = #{zlzxqk},
            </if>
            <if test="zlfqrq != null">
                zlfqrq = #{zlfqrq},
            </if>
            <if test="zlfqsj != null">
                zlfqsj = #{zlfqsj},
            </if>
            <if test="zldj != null and zldj != ''">
                zldj = #{zldj},
            </if>
            <if test="zljsdx != null and zljsdx != ''">
                zljsdx = #{zljsdx},
            </if>


            <if test="qsyxsj != null">
                qsyxsj = #{qsyxsj},
            </if>
            <if test="qssj != null">
                qssj = #{qssj},
            </if>
            <if test="qszt != null and qszt != ''">
                qszt = #{qszt},
            </if>
            <if test="ddxcyxsj != null">
                ddxcyxsj = #{ddxcyxsj},
            </if>
            <if test="ddxcsj != null">
                ddxcsj = #{ddxcsj},
            </if>
            <if test="ddxczt != null and ddxczt != ''">
                ddxczt = #{ddxczt},
            </if>
            <if test="zlwjyxsj != null">
                zlwjyxsj = #{zlwjyxsj},
            </if>
            <if test="zlwjsj != null">
                zlwjsj = #{zlwjsj},
            </if>
            <if test="zlwjsm != null and zlwjsm != ''">
                zlwjsm = #{zlwjsm},
            </if>
            <if test="zlwjzt != null and zlwjzt != ''">
                zlwjzt = #{zlwjzt},
            </if>
            <if test="zlzxzt != null and zlzxzt != ''">
                zlzxzt = #{zlzxzt},
            </if>
            <if test="jd != null">
                jd = #{jd},
            </if>
            <if test="wd != null">
                wd = #{wd},
            </if>
            <if test="zb != null">
                zb = ST_GEOMFROMTEXT(#{zb,typeHandler=com.mosty.base.feign.handle.PointTypeHandler}),
            </if>
            <if test="zbhash != null and zbhash != ''">
                zbhash = #{zbhash},
            </if>
            <if test="zlfsddxzqh != null and zlfsddxzqh != ''">
                zlfsddxzqh = #{zlfsddxzqh},
            </if>
            <if test="zlfsdd != null and zlfsdd != ''">
                zlfsdd = #{zlfsdd},
            </if>
            <if test="zlfqrId != null and zlfqrId != ''">
                zlfqr_id = #{zlfqrId},
            </if>
            <if test="zlfqr != null and zlfqr != ''">
                zlfqr = #{zlfqr},
            </if>
            <if test="zlfqrSfzh != null and zlfqrSfzh != ''">
                zlfqr_sfzh = #{zlfqrSfzh},
            </if>
            <if test="zlfqrDh != null and zlfqrDh != ''">
                zlfqr_dh = #{zlfqrDh},
            </if>
            <if test="fjId != null and fjId != ''">
                fj_id = #{fjId},
            </if>
            <if test="zljsrs != null">
                zljsrs = #{zljsrs},
            </if>
            <if test="zltp != null and zltp != ''">
                zltp = #{zltp},
            </if>
            <if test="ssbm != null and ssbm != ''">
                ssbm = #{ssbm},
            </if>
            <if test="ssbmdm != null and ssbmdm != ''">
                ssbmdm = #{ssbmdm},
            </if>
            <if test="ssbmid != null and ssbmid != ''">
                ssbmid = #{ssbmid},
            </if>
            <if test="ssxgaj != null and ssxgaj != ''">
                ssxgaj = #{ssxgaj},
            </if>
            <if test="ssxgajdm != null and ssxgajdm != ''">
                ssxgajdm = #{ssxgajdm},
            </if>
            <if test="ssxgajid != null and ssxgajid != ''">
                ssxgajid = #{ssxgajid},
            </if>
            <if test="sssgaj != null and sssgaj != ''">
                sssgaj = #{sssgaj},
            </if>
            <if test="sssgajdm != null and sssgajdm != ''">
                sssgajdm = #{sssgajdm},
            </if>
            <if test="sssgajid != null and sssgajid != ''">
                sssgajid = #{sssgajid},
            </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>
