<?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.wzzx.mapper.TbWzSbsswzMapper">

    <insert id="insertEntity" parameterType="com.mosty.base.model.entity.wzzx.TbWzSbsswz">
        insert into tb_wz_sbsswz (id, sjly, sjlydm, ywid, sbid, sbmc, yh_id, yh_xm,
                                yh_sfzh, jz_id, jz_mc, dwrq, dwsj, jd, wd, zb,
                                zbhash, wztgz, guo, sheng, shi, csbm, ssqx,
                                qxbm, dzxz, dzjc, dwbz, xfsc, xflc,
                                ssbm, ssbmdm, ssxgaj, ssxgajdm,ssbmid,ssxgajid,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}, #{sjly}, #{sjlydm}, #{ywid}, #{sbid}, #{sbmc}, #{yhId}, #{yhXm},
                #{yhSfzh}, #{jzId}, #{jzMc}, #{dwrq}, #{dwsj}, #{jd}, #{wd},
                ST_GEOMFROMTEXT(#{zb, typeHandler = com.mosty.base.feign.handle.PointTypeHandler}),
                                #{zbhash},#{wztgz},#{guo},#{sheng},#{shi},#{csbm},#{ssqx},
                                #{qxbm},#{dzxz},#{dzjc},#{dwbz},#{xfsc},#{xflc},
                                #{ssbm}, #{ssbmdm}, #{ssxgaj}, #{ssxgajdm},#{ssbmid},#{ssxgajid},#{sssgajid},
                                #{sssgaj}, #{sssgajdm}, #{xtSjly}, #{xtSjzt}, #{xtScbz}, #{xtCjip}, #{xtCjsj}, #{xtCjrId}, #{xtCjr},
                                #{xtCjbmdm}, #{xtCjbmmc}, #{xtZhgxip},
                                #{xtZhgxsj}, #{xtZhgxrid}, #{xtZhgxr}, #{xtZhgxbmdm}, #{xtZhgxbm}, #{bz})
    </insert>

    <!--删除7日前数据-->
    <delete id="delHistory" parameterType="java.lang.String">
        delete from tb_wz_sbsswz where DATE(dwsj) &lt;= DATE(DATE_SUB(NOW(),INTERVAL 7 DAY));
    </delete>

</mapper>
