| | |
| | | <result column="area_divide_id" property="areaDivideId"/> |
| | | <result column="area_type_key" property="areaTypeKey"/> |
| | | <result column="area_type_value" property="areaTypeValue"/> |
| | | <result column="geom" property="geom"/> |
| | | <result column="geom_json" property="geomJson"/> |
| | | <result column="area_code" property="areaCode"/> |
| | | </resultMap> |
| | | |
| | | <select id="getByAreaDivideId" resultMap="fwAreaDivideExtResultMap"> |
| | | select |
| | | id, |
| | | area_divide_id, |
| | | area_type_key, |
| | | area_type_value, |
| | | case |
| | | when geom is null then null |
| | | when ST_SRID(geom) is null |
| | | or ST_SRID(geom) = 0 then ST_AsText(geom) |
| | | else concat(ST_AsText(ST_SwapXY(geom)), ' | ', ST_SRID(geom)) |
| | | end as geom, |
| | | area_code, |
| | | create_user, |
| | | create_dept, |
| | | create_time, |
| | | update_user, |
| | | update_time, |
| | | status, |
| | | is_deleted |
| | | * |
| | | from ja_fw_area_divide_ext where is_deleted = 0 and area_divide_id = #{areaDivideId} |
| | | </select> |
| | | |
| | |
| | | area_divide_id, |
| | | area_type_key, |
| | | area_type_value, |
| | | geom, |
| | | geom_json, |
| | | area_code, |
| | | create_user, |
| | | create_dept, |
| | |
| | | #{item.areaDivideId}, |
| | | #{item.areaTypeKey}, |
| | | #{item.areaTypeValue}, |
| | | <choose> |
| | | <when test="item.geom != null and item.geom != ''"> |
| | | case |
| | | when instr(#{item.geom}, '|') > 0 then ST_SRID( |
| | | ST_GeomFromText(trim(substring_index(#{item.geom}, '|', 1))), |
| | | cast(trim(substring_index(#{item.geom}, '|', -1)) as unsigned) |
| | | ) |
| | | else ST_GeomFromText(trim(#{item.geom})) |
| | | end |
| | | </when> |
| | | <otherwise>null</otherwise> |
| | | </choose>, |
| | | #{item.geomJson}, |
| | | #{item.areaCode}, |
| | | #{item.createUser}, |
| | | #{item.createDept}, |
| | | #{item.createTime}, |
| | | #{item.updateUser}, |
| | | #{item.updateTime}, |
| | | IFNULL(#{item.status}, '0'), |
| | | IFNULL(#{item.isDeleted}, 0) |
| | | COALESCE(#{item.status}, '0'), |
| | | COALESCE(#{item.isDeleted}, 0) |
| | | ) |
| | | </foreach> |
| | | </insert> |