|
@@ -50,7 +50,7 @@
|
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
|
<result column="kind" jdbcType="VARCHAR" property="kind"/>
|
|
|
<result column="gis" jdbcType="VARCHAR" property="gis"
|
|
|
- typeHandler="com.shkpr.service.alambizplugin.dbdao.pgtype.GeomMultiLineStringTypeHandlePg"/>
|
|
|
+ typeHandler="com.shkpr.service.alambizplugin.dbdao.pgtype.GeomLineStringTypeHandlePg"/>
|
|
|
<result column="apply" jdbcType="VARCHAR" property="apply"/>
|
|
|
<result column="source" jdbcType="SMALLINT" property="source"/>
|
|
|
<result column="up_node" jdbcType="VARCHAR" property="upNode"/>
|
|
@@ -63,107 +63,107 @@
|
|
|
|
|
|
<select id="findAddUpdatePointByProjId" fetchSize="3000" resultMap="Point">
|
|
|
select la.code, la.job_id, la.layer, la.kind, la.gis, la.apply, la.source, la.elevation, la.no,
|
|
|
- case when lt.name is null then
|
|
|
- (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
- else lt.name end as name
|
|
|
+ case when lt.name is null then
|
|
|
+ (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
+ else lt.name end as name
|
|
|
from k3_gis_survey_layer_apply la
|
|
|
- join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
- join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
- left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
+ join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
+ join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
+ left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
where pit.uid = #{projId,jdbcType=VARCHAR}
|
|
|
- and jo.disused = 0
|
|
|
- and (la.apply = 'add' or la.apply = 'update') and la.kind = 'point'
|
|
|
+ and jo.disused = 0
|
|
|
+ and (la.apply = 'add' or la.apply = 'update') and la.kind = 'point'
|
|
|
</select>
|
|
|
|
|
|
<select id="findAddUpdateLineByProjId" fetchSize="3000" resultMap="Line">
|
|
|
select la.code, la.job_id, la.layer, la.kind, la.apply, la.source, la.up_node, la.down_node,
|
|
|
- un.no as up_no, dn.no as down_no,
|
|
|
- case when un.code is not null and dn.code is not null then concat('[[', un.gis, ',', dn.gis, ']]') else la.gis end
|
|
|
- as gis,
|
|
|
- abs(coalesce(un.elevation, 0)::numeric - coalesce(dn.elevation, 0)::numeric) as elevation_diff,
|
|
|
- sl.value as survey_length,
|
|
|
- case when lt.name is null then
|
|
|
- (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
- else lt.name end as name
|
|
|
+ un.no as up_no, dn.no as down_no,
|
|
|
+ case when un.code is not null and dn.code is not null then concat('[', un.gis, ',', dn.gis, ']') else la.gis end
|
|
|
+ as gis,
|
|
|
+ abs(coalesce(un.elevation, 0)::numeric - coalesce(dn.elevation, 0)::numeric) as elevation_diff,
|
|
|
+ sl.value as survey_length,
|
|
|
+ case when lt.name is null then
|
|
|
+ (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
+ else lt.name end as name
|
|
|
from k3_gis_survey_layer_apply as la
|
|
|
- join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
- join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
- left join k3_gis_survey_layer_apply as un
|
|
|
- on la.up_node = un.code and un.kind = 'point' and la.job_id = un.job_id
|
|
|
- left join k3_gis_survey_layer_apply as dn
|
|
|
- on la.down_node = dn.code and dn.kind = 'point' and la.job_id = dn.job_id
|
|
|
- left join k3_gis_survey_property_value sl on la.code = sl.code and la.job_id = sl.job_id and property =
|
|
|
- 'survey_length'
|
|
|
- left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
+ join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
+ join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
+ left join k3_gis_survey_layer_apply as un
|
|
|
+ on la.up_node = un.code and un.kind = 'point' and la.job_id = un.job_id
|
|
|
+ left join k3_gis_survey_layer_apply as dn
|
|
|
+ on la.down_node = dn.code and dn.kind = 'point' and la.job_id = dn.job_id
|
|
|
+ left join k3_gis_survey_property_value sl on la.code = sl.code and la.job_id = sl.job_id and property =
|
|
|
+ 'survey_length'
|
|
|
+ left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
where pit.uid = #{projId,jdbcType=VARCHAR}
|
|
|
- and jo.disused = 0
|
|
|
- and (la.apply = 'add' or la.apply = 'update') and la.kind = 'line';
|
|
|
+ and jo.disused = 0
|
|
|
+ and (la.apply = 'add' or la.apply = 'update') and la.kind = 'line';
|
|
|
</select>
|
|
|
|
|
|
<select id="findAddUpdatePointByJobId" fetchSize="3000" resultMap="Point">
|
|
|
select la.code, la.job_id, la.layer, la.kind, la.gis, la.apply, la.source, la.elevation, la.no,
|
|
|
- case when lt.name is null then
|
|
|
- (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
- else lt.name end as name
|
|
|
+ case when lt.name is null then
|
|
|
+ (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
+ else lt.name end as name
|
|
|
from k3_gis_survey_layer_apply la
|
|
|
- join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
- join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
- left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
+ join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
+ join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
+ left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
where jo.uid = #{jobId,jdbcType=VARCHAR}
|
|
|
- and (la.apply = 'add' or la.apply = 'update') and la.kind = 'point'
|
|
|
+ and (la.apply = 'add' or la.apply = 'update') and la.kind = 'point'
|
|
|
</select>
|
|
|
|
|
|
<select id="findAddUpdateLineByJobId" fetchSize="3000" resultMap="Line">
|
|
|
select la.code, la.job_id, la.layer, la.kind, la.apply, la.source, la.up_node, la.down_node,
|
|
|
- un.no as up_no, dn.no as down_no,
|
|
|
- case when un.code is not null and dn.code is not null then concat('[[', un.gis, ',', dn.gis, ']]') else la.gis end
|
|
|
- as gis,
|
|
|
- abs(coalesce(un.elevation, 0)::numeric - coalesce(dn.elevation, 0)::numeric) as elevation_diff,
|
|
|
- sl.value as survey_length,
|
|
|
- case when lt.name is null then
|
|
|
- (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
- else lt.name end as name
|
|
|
+ un.no as up_no, dn.no as down_no,
|
|
|
+ case when un.code is not null and dn.code is not null then concat('[', un.gis, ',', dn.gis, ']') else la.gis end
|
|
|
+ as gis,
|
|
|
+ abs(coalesce(un.elevation, 0)::numeric - coalesce(dn.elevation, 0)::numeric) as elevation_diff,
|
|
|
+ sl.value as survey_length,
|
|
|
+ case when lt.name is null then
|
|
|
+ (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
+ else lt.name end as name
|
|
|
from k3_gis_survey_layer_apply as la
|
|
|
- join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
- join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
- left join k3_gis_survey_layer_apply as un
|
|
|
- on la.up_node = un.code and un.kind = 'point' and la.job_id = un.job_id
|
|
|
- left join k3_gis_survey_layer_apply as dn
|
|
|
- on la.down_node = dn.code and dn.kind = 'point' and la.job_id = dn.job_id
|
|
|
- left join k3_gis_survey_property_value sl on la.code = sl.code and la.job_id = sl.job_id and property =
|
|
|
- 'survey_length'
|
|
|
- left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
+ join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
+ join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
+ left join k3_gis_survey_layer_apply as un
|
|
|
+ on la.up_node = un.code and un.kind = 'point' and la.job_id = un.job_id
|
|
|
+ left join k3_gis_survey_layer_apply as dn
|
|
|
+ on la.down_node = dn.code and dn.kind = 'point' and la.job_id = dn.job_id
|
|
|
+ left join k3_gis_survey_property_value sl on la.code = sl.code and la.job_id = sl.job_id and property =
|
|
|
+ 'survey_length'
|
|
|
+ left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
where jo.uid = #{jobId,jdbcType=VARCHAR}
|
|
|
- and (la.apply = 'add' or la.apply = 'update') and la.kind = 'line';
|
|
|
+ and (la.apply = 'add' or la.apply = 'update') and la.kind = 'line';
|
|
|
</select>
|
|
|
|
|
|
<select id="findAllByJobIdAndKind" fetchSize="3000" resultMap="BaseResultMap">
|
|
|
select la.code, la.job_id, la.layer, la.kind, la.apply, la.source, la.up_node, la.down_node,la.elevation,
|
|
|
- la.depth, la.no,
|
|
|
- case when la.kind = 'line' and un.code is not null and dn.code is not null
|
|
|
- then concat('[[', un.gis, ',', dn.gis, ']]') else la.gis end as gis,
|
|
|
- case when lt.name is null then
|
|
|
- (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
- else lt.name end as name,
|
|
|
- pv.property as property_property, pv.code as property_code, pv.job_id as property_job_id,
|
|
|
- pv.value as property_value
|
|
|
+ la.depth, la.no,
|
|
|
+ case when la.kind = 'line' and un.code is not null and dn.code is not null
|
|
|
+ then concat('[', un.gis, ',', dn.gis, ']') else la.gis end as gis,
|
|
|
+ case when lt.name is null then
|
|
|
+ (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
|
|
|
+ else lt.name end as name,
|
|
|
+ pv.property as property_property, pv.code as property_code, pv.job_id as property_job_id,
|
|
|
+ pv.value as property_value
|
|
|
from k3_gis_survey_layer_apply as la
|
|
|
- join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
- join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
- left join k3_gis_survey_layer_apply as un
|
|
|
- on la.up_node = un.code and un.kind = 'point' and la.job_id = un.job_id
|
|
|
- left join k3_gis_survey_layer_apply as dn
|
|
|
- on la.down_node = dn.code and dn.kind = 'point' and la.job_id = dn.job_id
|
|
|
- left join k3_gis_survey_property_value pv on la.code = pv.code and la.job_id = pv.job_id
|
|
|
- left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
+ join k3_gis_survey_job_info jo on la.job_id = jo.uid
|
|
|
+ join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
|
|
|
+ left join k3_gis_survey_layer_apply as un
|
|
|
+ on la.up_node = un.code and un.kind = 'point' and la.job_id = un.job_id
|
|
|
+ left join k3_gis_survey_layer_apply as dn
|
|
|
+ on la.down_node = dn.code and dn.kind = 'point' and la.job_id = dn.job_id
|
|
|
+ left join k3_gis_survey_property_value pv on la.code = pv.code and la.job_id = pv.job_id
|
|
|
+ left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
|
|
|
where la.job_id = #{jobId,jdbcType=VARCHAR} and la.kind = #{kind,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
<insert id="mergeCopyByJobId">
|
|
|
insert into k3_gis_survey_layer_apply(code, job_id, layer, kind, gis, apply, source, up_node,
|
|
|
- down_node,elevation,depth,no)
|
|
|
+ down_node,elevation,depth,no)
|
|
|
select code, job_id, layer, kind, gis, apply, source, up_node,
|
|
|
- down_node,elevation,depth,no
|
|
|
+ down_node,elevation,depth,no
|
|
|
from k3_gis_survey_layer_apply_third_copy
|
|
|
where job_id = #{jobId,jdbcType=VARCHAR}
|
|
|
order by job_id, code
|