<?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="org.jeecg.modules.zrzyqc.qcsb.mapper.QcSsgqzysytdqkMapper">
    <update id="upSfsb" parameterType="String">
        update qc_ssgqzysytdqk set sfsb=1 where id=#{id} and sfsb=0
    </update>
    <select id="selectQyxx" parameterType="String" resultType="org.jeecg.modules.zrzyqc.qyxx.entity.QcQyxx">
        select * from qc_qyxx where create_by=#{username} and sys_org_code=#{orgCode}
    </select>
    <insert id="insertDkxx" parameterType="hashmap"  >
        insert into dkxx(id,dkmc,xmid,shape,area)
        values (#{id},#{dkmc}, #{xmid},MDSYS.sdo_geometry(2003,'4326',null,sdo_elem_info_array(
        <foreach collection="recod" item="item" index="index" separator=",">
            #{item}
        </foreach>
        ),sdo_ordinate_array(
        <foreach collection="shape" item="item" index="index" separator=",">
            #{item}
        </foreach>
        )),
        round(SDO_GEOM.SDO_AREA(sdo_cs.transform((sdo_geometry(2003,'4326',null,sdo_elem_info_array(
        <foreach collection="recod" item="item" index="index" separator=",">
            #{item}
        </foreach>
        ),sdo_ordinate_array(
        <foreach collection="shape" item="item" index="index" separator=",">
            #{item}
        </foreach>
        ))),4527),0.05)*0.0001,4)
        )
    </insert>
</mapper>
