<?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.TbYjxxRyMapper">
    <resultMap type="com.mosty.base.model.entity.yjzl.TbYjxxRy" id="tbYjxxRy">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="yjId" column="yj_id" jdbcType="VARCHAR"/>
        <result property="yjClid" column="yj_clid" jdbcType="VARCHAR"/>
        <result property="sjId" column="sj_id" jdbcType="VARCHAR"/>
        <result property="yjSjly" column="yj_sjly" jdbcType="VARCHAR"/>
        <result property="yjGzyid" column="yj_gzyid" jdbcType="VARCHAR"/>
        <result property="yjGzymc" column="yj_gzymc" jdbcType="VARCHAR"/>
        <result property="yjFssj" column="yj_fssj" jdbcType="TIMESTAMP"/>
        <result property="yjSj" column="yj_sj" jdbcType="TIMESTAMP"/>
        <result property="yjJb" column="yj_jb" jdbcType="VARCHAR"/>
        <result property="yjBt" column="yj_bt" jdbcType="VARCHAR"/>
        <result property="yjNr" column="yj_nr" jdbcType="VARCHAR"/>
        <result property="yjRybq" column="yj_rybq" jdbcType="VARCHAR"/>
        <result property="yjRybqmc" column="yj_rybqmc" jdbcType="VARCHAR"/>
        <result property="yjZjlx" column="yj_zjlx" jdbcType="VARCHAR"/>
        <result property="yjZjhm" column="yj_zjhm" jdbcType="VARCHAR"/>
        <result property="yjRyxm" column="yj_ryxm" jdbcType="VARCHAR"/>
        <result property="yjRyxb" column="yj_ryxb" jdbcType="VARCHAR"/>
        <result property="yjRynl" column="yj_rynl" jdbcType="VARCHAR"/>
        <result property="yjRymz" column="yj_rymz" jdbcType="VARCHAR"/>
        <result property="yjRyjg" column="yj_ryjg" jdbcType="VARCHAR"/>
        <result property="yjRyhjdXzqh" column="yj_ryhjd_xzqh" jdbcType="VARCHAR"/>
        <result property="yjRyhjd" column="yj_ryhjd" jdbcType="NUMERIC"/>
        <result property="yjRyjzdXzqh" column="yj_ryjzd_xzqh" jdbcType="INTEGER"/>
        <result property="yjRyjzd" column="yj_ryjzd" jdbcType="TIMESTAMP"/>
        <result property="yjRygzdwid" column="yj_rygzdwid" jdbcType="TIMESTAMP"/>
        <result property="yjRygzdw" column="yj_rygzdw" jdbcType="VARCHAR"/>
        <result property="yjRylxdh" column="yj_rylxdh" jdbcType="VARCHAR"/>
        <result property="yjXsd" column="yj_xsd" jdbcType="VARCHAR"/>
        <result property="yjXwms" column="yj_xwms" jdbcType="VARCHAR"/>
        <result property="ltx" column="ltx" jdbcType="VARCHAR"/>
        <result property="lty" column="lty" jdbcType="VARCHAR"/>
        <result property="rbx" column="rbx" jdbcType="VARCHAR"/>
        <result property="rby" column="rby" 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.PointTypeHandler"/>
        <result property="zbhash" column="zbhash" jdbcType="VARCHAR"/>
        <result property="yjDzxzqh" column="yj_dzxzqh" jdbcType="VARCHAR"/>
        <result property="yjDz" column="yj_dz" jdbcType="VARCHAR"/>
        <result property="tpId" column="tp_id" jdbcType="VARCHAR"/>
        <result property="coverImage" column="cover_image" jdbcType="VARCHAR"/>
        <result property="yjlyBqmc" column="yjly_bqmc" 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>

    <insert id="insertEntity">
        insert into mosty_yjzl.tb_yjxx_ry(id, yj_id, yj_clid, sj_id, yj_sjly, yj_gzyid, yj_gzymc, yj_fssj, yj_sj, yj_jb,
                                          yj_bt, ssbmid, ssxgajid, sssgajid,
                                          yj_nr,
                                          yj_rybq, yj_rybqmc, yj_zjlx, yj_zjhm, yj_ryxm, yj_ryxb, yj_rynl, yj_rymz,
                                          yj_ryjg, yj_ryhjd_xzqh, yj_ryhjd,
                                          yj_ryjzd_xzqh, yj_ryjzd, yj_rygzdwid, yj_rygzdw, yj_rylxdh, yj_xsd, yj_xwms,
                                          ltx, lty, rbx, rby, jd, wd,
                                          zb, zbhash, yj_dzxzqh, yj_dz, tp_id, cover_image, yjly_bqmc,
                                          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}, #{yjId}, #{yjClid}, #{sjId}, #{yjSjly}, #{yjGzyid}, #{yjGzymc}, #{yjFssj}, #{yjSj}, #{yjJb},
                #{yjBt}, #{ssbmid}, #{ssxgajid}, #{sssgajid},
                #{yjNr},
                #{yjRybq}, #{yjRybqmc}, #{yjZjlx}, #{yjZjhm}, #{yjRyxm}, #{yjRyxb}, #{yjRynl}, #{yjRymz}, #{yjRyjg},
                #{yjRyhjdXzqh}, #{yjRyhjd},
                #{yjRyjzdXzqh}, #{yjRyjzd}, #{yjRygzdwid}, #{yjRygzdw}, #{yjRylxdh}, #{yjXsd}, #{yjXwms}, #{ltx},
                #{lty}, #{rbx},
                #{rby}, #{jd}, #{wd}, ST_GEOMFROMTEXT(#{zb,typeHandler = com.mosty.base.feign.handle.PointTypeHandler}),
                #{zbhash}, #{yjDzxzqh}, #{yjDz}, #{tpId}, #{coverImage}, #{yjlyBqmc},
                #{ssbm}, #{ssbmdm}, #{ssxgaj}, #{ssxgajdm}, #{sssgaj}, #{sssgajdm}, #{xtSjly}, #{xtSjzt},
                #{xtScbz}, #{xtCjip}, #{xtCjsj}, #{xtCjrId}, #{xtCjr}, #{xtCjbmdm}, #{xtCjbmmc}, #{xtZhgxip},
                #{xtZhgxsj}, #{xtZhgxrid}, #{xtZhgxr}, #{xtZhgxbmdm}, #{xtZhgxbm}, #{bz})
    </insert>

    <!--根据ID删除-->
    <update id="deleteByIds">
        update tb_yjxx_ry set xt_scbz = '1' where id in
        <foreach collection="list" item="item" separator="," open="(" close=")">
            #{item}
        </foreach>
    </update>

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