<?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.TbYjxxSjMapper">

    <resultMap type="com.mosty.base.model.entity.yjzl.TbYjxxSj" id="tbYjxx">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="yjId" column="yj_id" jdbcType="VARCHAR"/>
        <result property="yjGzyid" column="yj_gzyid" jdbcType="VARCHAR"/>
        <result property="sjFl" column="sj_fl" jdbcType="VARCHAR"/>
        <result property="sjFlmc" column="sj_flmc" jdbcType="DATE"/>
        <result property="yjJb" column="yj_jb" jdbcType="DATE"/>
        <result property="yjFssj" column="yj_fssj" jdbcType="DATE"/>
        <result property="yjSj" column="yj_sj" jdbcType="VARCHAR"/>
        <result property="yjBt" column="yj_bt" jdbcType="NUMERIC"/>
        <result property="yjNr" column="yj_nr" jdbcType="NUMERIC"/>
        <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_dz_xzqh" jdbcType="VARCHAR"/>
        <result property="yjDz" column="yj_dz" jdbcType="VARCHAR"/>
        <result property="yjTp" column="yj_tp" 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>

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

    <!--根据指令ID删除明细-->
    <update id="deleteByYjId">
        update tb_yjxx_sj set xt_scbz = '1' where yj_id = #{yjid}
    </update>

    <insert id="insertEntity">
        insert into mosty_yjzl.tb_yjxx_sj(id,yj_id,yj_gzyid,sj_fl,sj_flmc,yj_jb,yj_fssj,yj_sj,yj_bt,yj_nr,
                        jd,wd,zb,zbhash,yj_dz_xzqh,yj_dz,yj_tp,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},#{yjId},#{yjGzyid},#{sjFl},#{sjFlmc},#{yjJb},#{yjFssj},#{yjSj},#{yjBt},#{yjNr},#{jd},#{wd},
                        ST_GEOMFROMTEXT(#{zb,typeHandler = com.mosty.base.feign.handle.PointTypeHandler}),
                        #{zbhash},#{yjDzXzqh},#{yjDz},#{yjTp},#{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>
</mapper>
