TUploadGeomMapper.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.onemap.file.mapper.TUploadGeomMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="TUploadGeomDTO" id="TUploadGeomDTOResult">
  6. <result property="uploaduser" column="uploaduser"/>
  7. <result property="uploadtime" column="uploadtime"/>
  8. <result property="unzippath" column="unzippath"/>
  9. <result property="spotsnumber" column="spotsnumber"/>
  10. <result property="spotsarea" column="spotsarea"/>
  11. <result property="shppath" column="shppath"/>
  12. <result property="name" column="name"/>
  13. <result property="id" column="id"/>
  14. <result property="geom" column="geom"/>
  15. <result property="fromtype" column="fromtype"/>
  16. <result property="fromroute" column="fromroute"/>
  17. <result property="filetype" column="filetype"/>
  18. <result property="filepath" column="filepath"/>
  19. </resultMap>
  20. <insert id="insertTUploadGeom" parameterType="TUploadGeomDTO">
  21. INSERT INTO t_upload_geom (id,name,uploaduser,uploadtime,unzippath,spotsnumber,spotsarea,shppath,geom,fromtype,fromroute,filetype,filepath)
  22. VALUES (#{id},#{name},#{uploaduser},now(), #{unzippath}, #{spotsnumber}, public.st_area(public.st_transform(public.st_geomfromewkt(#{geom}), #{sridarea})),#{shppath},
  23. public.st_transform(public.st_geomfromewkt(#{geom}), 4326),#{fromtype},#{fromroute},#{filetype},#{filepath})
  24. </insert>
  25. <select id="selectTUploadGeomById" parameterType="String" resultMap="TUploadGeomDTOResult">
  26. select id,name,uploaduser,uploadtime,unzippath,spotsnumber,round(spotsarea,2) spotsarea,shppath,public.st_asewkt(geom) AS geom,fromtype,fromroute,filetype,filepath
  27. from t_upload_geom
  28. where id = #{id}
  29. </select>
  30. <delete id="deleteTUploadGeomById" parameterType="String">
  31. delete from t_upload_geom where id = #{id}
  32. </delete>
  33. </mapper>