<?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.sjzx.mapper.TbSjDzMapper">

    <resultMap type="com.mosty.base.model.entity.sjzx.TbSjDz" id="tbSjdzMap">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="sjId" column="sj_id" jdbcType="VARCHAR"/>
        <result property="dztzSj" column="dztz_sj" jdbcType="TIMESTAMP"/>
        <result property="dztzRyid" column="dztz_ryid" jdbcType="VARCHAR"/>
        <result property="dztzRysfzh" column="dztz_rysfzh" jdbcType="VARCHAR"/>
        <result property="dztzRyxm" column="dztz_ryxm" jdbcType="VARCHAR"/>
        <result property="jd" column="jd" jdbcType="NUMERIC"/>
        <result property="wd" column="wd" jdbcType="NUMERIC"/>
        <result property="zb" column="zb" typeHandler="com.mosty.base.feign.handle.PolygonTypeHandler"/>
        <result property="zbhash" column="zbhash" jdbcType="VARCHAR"/>
        <result property="dzxzqh" column="dzxzqh" jdbcType="VARCHAR"/>
        <result property="dz" column="dz" jdbcType="VARCHAR"/>
        <result property="tpId" column="tp_id" jdbcType="VARCHAR"/>
        <result property="ssbm" column="ssbm" jdbcType="VARCHAR"/>
        <result property="ssbmdm" column="ssbmdm" jdbcType="VARCHAR"/>
        <result property="ssxgaj" column="ssxgaj" jdbcType="VARCHAR"/>
        <result property="ssxgajdm" column="ssxgajdm" jdbcType="VARCHAR"/>
        <result property="sssgaj" column="sssgaj" 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="VARCHAR"/>
        <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="VARCHAR"/>
        <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"/>
        <result property="sssgajid" column="sssgajid" jdbcType="VARCHAR"/>
        <result property="ssxgajid" column="ssxgajid" jdbcType="VARCHAR"/>
        <result property="ssbmid" column="ssbmid" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="base_column_list">
        id
        ,sj_id,dztz_sj,dztz_ryid,dztz_rysfzh,dztz_ryxm,jd,wd,ssbmid,ssxgajid,sssgajid,
        zbhash,dzxzqh,dz,tp_id,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
    </sql>

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

    <insert id="insertEntity" parameterType="com.mosty.base.model.entity.sjzx.TbSjDz">
        insert into tb_sj_dz
        (id,sj_id,dztz_sj,dztz_ryid,dztz_rysfzh,dztz_ryxm,jd,wd,zb,ssbmid,ssxgajid,sssgajid,
         zbhash,dzxzqh,dz,tp_id, 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}, #{sjId}, #{dztzSj}, #{dztzRyid}, #{dztzRysfzh}, #{dztzRyxm}, #{jd},
                #{wd},
                ST_GEOMFROMTEXT(#{zb,typeHandler = com.mosty.base.feign.handle.PolygonTypeHandler}),#{ssbmid},#{ssxgajid},#{sssgajid},
                #{zbhash},
                #{dzxzqh}, #{dz},#{tpId}, #{ssbm}, #{ssbmdm}, #{ssxgaj}, #{ssxgajdm}, #{sssgaj}, #{sssgajdm},
                #{xtSjly}, #{xtSjzt}, #{xtScbz}, #{xtCjip}, #{xtCjsj}, #{xtCjrId},#{xtCjr}, #{xtCjbmdm},
                #{xtCjbmmc}, #{xtZhgxip}, #{xtZhgxsj}, #{xtZhgxrid},#{xtZhgxr}, #{xtZhgxbmdm}, #{xtZhgxbm}, #{bz})
    </insert>
</mapper>


