20260407
This commit is contained in:
parent
d22c0aa8aa
commit
d343170a09
|
|
@ -1,3 +1 @@
|
|||
/app.properties
|
||||
/cn/
|
||||
/jdbc.properties
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -8,7 +8,7 @@
|
|||
<select id="dataWithPage" resultType="map">
|
||||
select * from dict_data where 1=1
|
||||
<if test="page_query != null and page_query != ''">
|
||||
and (data_name like concat('%',#{page_query},'%') or data_remark like concat('%',#{page_query},'%') or data_alias like concat('%',#{page_query},'%'))
|
||||
and (data_name like concat('%',#{page_query},'%') or data_eng like concat('%',#{page_query},'%') or data_alias like concat('%',#{page_query},'%'))
|
||||
</if>
|
||||
<if test="page_order != null and page_order != ''">
|
||||
ORDER BY ${page_order}
|
||||
|
|
@ -56,4 +56,8 @@
|
|||
</select>
|
||||
|
||||
|
||||
|
||||
<update id="updateSample">
|
||||
update sample_dataset set data_type=#{data.data_name},data_alias=#{data.data_alias} where data_id=#{data.tsy_id}
|
||||
</update>
|
||||
</mapper>
|
||||
Binary file not shown.
|
|
@ -9,7 +9,7 @@
|
|||
select * from dict_equipment where 1=1
|
||||
<if test="page_query != null and page_query != ''">
|
||||
and (equipment_name like concat('%',#{page_query},'%')
|
||||
or equipment_remark like concat('%',#{page_query},'%')
|
||||
or equipment_eng like concat('%',#{page_query},'%')
|
||||
or equipment_alias like concat('%',#{page_query},'%'))
|
||||
</if>
|
||||
<if test="page_order != null and page_order != ''">
|
||||
|
|
@ -58,4 +58,11 @@
|
|||
order by v.equipment_name
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="updateSample">
|
||||
update sample_dataset set equipment_type=#{equipment.equipment_name},equipment_alias=#{equipment.equipment_alias} where equipment_id=#{equipment.tsy_id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Binary file not shown.
|
|
@ -8,7 +8,7 @@
|
|||
<select id="platformWithPage" resultType="map">
|
||||
select * from dict_platform where 1=1
|
||||
<if test="page_query != null and page_query != ''">
|
||||
and (platform_name like concat('%',#{page_query},'%') or platform_remark like concat('%',#{page_query},'%') or platform_alias like concat('%',#{page_query},'%'))
|
||||
and (platform_name like concat('%',#{page_query},'%') or platform_eng like concat('%',#{page_query},'%') or platform_alias like concat('%',#{page_query},'%'))
|
||||
</if>
|
||||
<if test="page_order != null and page_order != ''">
|
||||
ORDER BY ${page_order}
|
||||
|
|
@ -56,4 +56,7 @@
|
|||
order by v.platform_name
|
||||
</select>
|
||||
|
||||
<update id="updateSample">
|
||||
update sample_dataset set platform_type=#{platform.platform_name},platform_alias=#{platform.platform_alias} where platform_id=#{platform.tsy_id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
<!-- 航次统计 -->
|
||||
<select id="reportShipTotal" resultType="map">
|
||||
SELECT
|
||||
count(1) voyage_total,
|
||||
<if test="year != null">
|
||||
date_part('year', voyage_start_date) as year,
|
||||
</if>
|
||||
|
|
@ -128,33 +129,77 @@
|
|||
<select id="reportPlatformTotal" resultType="map">
|
||||
SELECT
|
||||
<if test="year != null">
|
||||
date_part('year', voyage_start_date) as year,
|
||||
date_part('year', r.voyage_start_date) as year,
|
||||
</if>
|
||||
sum(water_minutes) water_total,sum(job_minutes) job_total,
|
||||
COUNT ( DISTINCT diving_sn ) diving_total,
|
||||
COUNT ( DISTINCT driver_left ) + COUNT ( DISTINCT driver_left ) driver_member_total,
|
||||
COUNT ( DISTINCT ds.driver_unit_left ) unit_left,
|
||||
COUNT ( DISTINCT ds.driver_unit_right ) unit_right,
|
||||
COUNT ( DISTINCT ds.driver_unit_left ) + COUNT ( DISTINCT ds.driver_unit_right ) unit_total,
|
||||
COUNT ( DISTINCT dataset_name ) dataset_total
|
||||
sum(ds.water_minutes) water_total,
|
||||
sum(ds.job_minutes) job_total,
|
||||
COUNT(DISTINCT ds.diving_sn) diving_total,
|
||||
COUNT(DISTINCT all_drivers.person_name) driver_member_total,
|
||||
COUNT(DISTINCT all_drivers.unit_name) unit_total,
|
||||
COUNT(DISTINCT ds.dataset_name) dataset_total
|
||||
FROM
|
||||
sample_dataset ds,
|
||||
voyage_reg r
|
||||
voyage_reg r,
|
||||
(
|
||||
SELECT
|
||||
voyage_id,
|
||||
driver_left AS person_name,
|
||||
driver_unit_left AS unit_name
|
||||
FROM
|
||||
sample_dataset s,
|
||||
voyage_reg r
|
||||
WHERE
|
||||
r.tsy_id = s.voyage_id
|
||||
AND platform_type IN (${platform_type})
|
||||
AND driver_left IS NOT NULL
|
||||
<if test="platform_name != null and platform_name!=''">
|
||||
AND platform_name = #{platform_name}
|
||||
</if>
|
||||
<if test="start != null">
|
||||
AND voyage_start_date >= #{start}
|
||||
</if>
|
||||
<if test="end != null">
|
||||
AND voyage_start_date <= #{end}
|
||||
</if>
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
voyage_id,
|
||||
driver_right AS person_name,
|
||||
driver_unit_right AS unit_name
|
||||
FROM
|
||||
sample_dataset s,
|
||||
voyage_reg r
|
||||
WHERE
|
||||
r.tsy_id = s.voyage_id
|
||||
AND platform_type IN (${platform_type})
|
||||
AND driver_right IS NOT NULL
|
||||
<if test="platform_name != null and platform_name!=''">
|
||||
AND platform_name = #{platform_name}
|
||||
</if>
|
||||
<if test="start != null">
|
||||
AND voyage_start_date >= #{start}
|
||||
</if>
|
||||
<if test="end != null">
|
||||
AND voyage_start_date <= #{end}
|
||||
</if>
|
||||
) all_drivers
|
||||
WHERE
|
||||
ds.voyage_id = r.tsy_id
|
||||
and platform_type in
|
||||
(${platform_type})
|
||||
AND ds.voyage_id = all_drivers.voyage_id
|
||||
AND platform_type IN (${platform_type})
|
||||
<if test="platform_name != null and platform_name!=''">
|
||||
and platform_name = #{platform_name}
|
||||
AND platform_name = #{platform_name}
|
||||
</if>
|
||||
<if test="start != null">
|
||||
and voyage_start_date >= #{start}
|
||||
AND voyage_start_date >= #{start}
|
||||
</if>
|
||||
<if test="end != null">
|
||||
and voyage_start_date <= #{end}
|
||||
AND voyage_start_date <= #{end}
|
||||
</if>
|
||||
<if test="year != null and year != ''">
|
||||
group by date_part('year', voyage_start_date)
|
||||
GROUP BY date_part('year', r.voyage_start_date)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
|
@ -309,7 +354,7 @@
|
|||
SELECT
|
||||
m.member_unit,
|
||||
m.member_name,
|
||||
COUNT(1) drving_total,
|
||||
COUNT(distinct diving_sn) drving_total,
|
||||
MIN(voyage_start_date) min_drving_date
|
||||
FROM
|
||||
voyage_reg r,
|
||||
|
|
@ -319,10 +364,10 @@
|
|||
r.tsy_id = m.voyage_id
|
||||
AND d.voyage_id = r.tsy_id
|
||||
AND (
|
||||
d.driver_unit_left = m.member_unit
|
||||
AND d.driver_left = m.member_name
|
||||
OR d.driver_unit_right = m.member_unit
|
||||
AND d.driver_right = m.member_name
|
||||
(d.driver_unit_left = m.member_unit
|
||||
AND d.driver_left = m.member_name)
|
||||
OR (d.driver_unit_right = m.member_unit
|
||||
AND d.driver_right = m.member_name)
|
||||
)
|
||||
GROUP BY
|
||||
m.member_unit,
|
||||
|
|
@ -422,7 +467,7 @@
|
|||
SELECT
|
||||
m.member_unit,
|
||||
m.member_name,
|
||||
COUNT(1) drving_total,
|
||||
COUNT(distinct diving_sn) drving_total,
|
||||
MIN(voyage_start_date) min_drving_date
|
||||
FROM
|
||||
voyage_reg r,
|
||||
|
|
@ -432,10 +477,10 @@
|
|||
r.tsy_id = m.voyage_id
|
||||
AND d.voyage_id = r.tsy_id
|
||||
AND (
|
||||
d.driver_unit_left = m.member_unit
|
||||
AND d.driver_left = m.member_name
|
||||
OR d.driver_unit_right = m.member_unit
|
||||
AND d.driver_right = m.member_name
|
||||
(d.driver_unit_left = m.member_unit
|
||||
AND d.driver_left = m.member_name)
|
||||
OR (d.driver_unit_right = m.member_unit
|
||||
AND d.driver_right = m.member_name)
|
||||
)
|
||||
GROUP BY
|
||||
m.member_unit,
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import cn.hme.framework.frame.control.HmeAjax;
|
||||
import cn.hme.framework.frame.control.HmeAjaxControl;
|
||||
import cn.hme.framework.helper.lang.HmeStringHelper;
|
||||
import cn.hme.framework.jdbc.entity.SqlCondition;
|
||||
import cn.hme.framework.jdbc.entity.SqlConditionType;
|
||||
import cn.hme.framework.jdbc.entity.SqlQuery;
|
||||
import cn.tsy.cas.idsse.dsds.thread.DSDSReportThread;
|
||||
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictReportMapper;
|
||||
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
|
||||
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
|
||||
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegReportMapper;
|
||||
|
||||
|
|
@ -24,6 +26,8 @@ public class DSDSReportControl extends HmeAjaxControl {
|
|||
@Autowired
|
||||
private IVoyageRegReportMapper iRegReport;
|
||||
@Autowired
|
||||
private ISampleDatasetMapper iSample;
|
||||
@Autowired
|
||||
private IDictReportMapper iReport;
|
||||
|
||||
@RequestMapping("main.htm")
|
||||
|
|
@ -40,7 +44,7 @@ public class DSDSReportControl extends HmeAjaxControl {
|
|||
}
|
||||
|
||||
/***************
|
||||
* 科考船汇总统计属性
|
||||
* 科考船汇总统计属性,和main保持一致
|
||||
*/
|
||||
@RequestMapping("ship/total.htm")
|
||||
public HmeAjax totalShip(String unit,String ship_name, LocalDate start, LocalDate end,Integer year) {
|
||||
|
|
@ -63,20 +67,30 @@ public class DSDSReportControl extends HmeAjaxControl {
|
|||
}
|
||||
|
||||
/***************
|
||||
* 参航单位地图
|
||||
* 统计参航单位列表(仅列出参航单位基本信息,用于地图标记)
|
||||
*/
|
||||
@RequestMapping("ship/unit.htm")
|
||||
public HmeAjax shipUnit(String ship_name, LocalDate start, LocalDate end,Integer year) {
|
||||
return new HmeAjax(this.iRegReport.reportShipUnit(ship_name, start, end,year));
|
||||
}
|
||||
/***************
|
||||
* 参航单位地图
|
||||
* 根据年份统计参航单位数量,本年度新增单位数量
|
||||
*/
|
||||
@RequestMapping("ship/unit/year.htm")
|
||||
public HmeAjax shipUnitYear(String ship_name) {
|
||||
return new HmeAjax(this.iRegReport.reportShipUnitWithYear(ship_name));
|
||||
}
|
||||
|
||||
|
||||
/***************
|
||||
* 平台类型下有多少平台
|
||||
*/
|
||||
@RequestMapping("platform/name.htm")
|
||||
public HmeAjax platformName(String platform_type) {
|
||||
return new HmeAjax(this.iSample.distinct("platform_name",String.class, SqlCondition.of("platform_type", platform_type), SqlCondition.of("platform_name", null,SqlConditionType.IS_NOT_NULL)));
|
||||
}
|
||||
|
||||
|
||||
/***************
|
||||
* 载人潜水器
|
||||
*/
|
||||
|
|
@ -188,7 +202,7 @@ public class DSDSReportControl extends HmeAjaxControl {
|
|||
|
||||
|
||||
/***************
|
||||
* 潜次统计:遥控水下机器人
|
||||
* 潜次统计:
|
||||
*/
|
||||
@RequestMapping("unit/total.htm")
|
||||
public HmeAjax unitTotal(String year,String unit) {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public class DictDataService {
|
|||
if (list.size() > 0 && list.get(0).getTsy_id() - data.getTsy_id() != 0)
|
||||
throw new BusinessException("数据样本类型名称【" + data.getData_name() + "】已经存在,请检查!");
|
||||
this.mData.update(data);
|
||||
// 同步更新样品集
|
||||
this.mData.updateSample(data);
|
||||
} else {
|
||||
HmeFrameAssertHelper.isEmpty(list, "数据样本类型名称【" + data.getData_name() + "】已经存在,请检查!");
|
||||
data.setCreate_time(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ public class DictPlatformService {
|
|||
throw new BusinessException("平台类型名称【" + platform.getPlatform_name() + "】已经存在,请检查!");
|
||||
// platform.setCreate_time(LocalDateTime.now());
|
||||
this.mPlatform.update(platform);
|
||||
|
||||
this.mPlatform.updateSample(platform);
|
||||
} else {
|
||||
HmeFrameAssertHelper.isEmpty(list, "平台类型名称【" + platform.getPlatform_name() + "】已经存在,请检查!");
|
||||
platform.setCreate_time(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -29,4 +29,7 @@ public interface IDictDataMapper extends IHmeMapper<DictData>{
|
|||
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
|
||||
@Param("param") SearchParam param
|
||||
);
|
||||
|
||||
|
||||
public void updateSample(@Param("data") DictData data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<select id="dataWithPage" resultType="map">
|
||||
select * from dict_data where 1=1
|
||||
<if test="page_query != null and page_query != ''">
|
||||
and (data_name like concat('%',#{page_query},'%') or data_remark like concat('%',#{page_query},'%') or data_alias like concat('%',#{page_query},'%'))
|
||||
and (data_name like concat('%',#{page_query},'%') or data_eng like concat('%',#{page_query},'%') or data_alias like concat('%',#{page_query},'%'))
|
||||
</if>
|
||||
<if test="page_order != null and page_order != ''">
|
||||
ORDER BY ${page_order}
|
||||
|
|
@ -56,4 +56,8 @@
|
|||
</select>
|
||||
|
||||
|
||||
|
||||
<update id="updateSample">
|
||||
update sample_dataset set data_type=#{data.data_name},data_alias=#{data.data_alias} where data_id=#{data.tsy_id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -29,4 +29,7 @@ public interface IDictEquipmentMapper extends IHmeMapper<DictEquipment>{
|
|||
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
|
||||
@Param("param") SearchParam param
|
||||
);
|
||||
|
||||
|
||||
public void updateSample(@Param("equipment") DictEquipment equipment);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
select * from dict_equipment where 1=1
|
||||
<if test="page_query != null and page_query != ''">
|
||||
and (equipment_name like concat('%',#{page_query},'%')
|
||||
or equipment_remark like concat('%',#{page_query},'%')
|
||||
or equipment_eng like concat('%',#{page_query},'%')
|
||||
or equipment_alias like concat('%',#{page_query},'%'))
|
||||
</if>
|
||||
<if test="page_order != null and page_order != ''">
|
||||
|
|
@ -58,4 +58,11 @@
|
|||
order by v.equipment_name
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="updateSample">
|
||||
update sample_dataset set equipment_type=#{equipment.equipment_name},equipment_alias=#{equipment.equipment_alias} where equipment_id=#{equipment.tsy_id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -29,4 +29,7 @@ public interface IDictPlatformMapper extends IHmeMapper<DictPlatform>{
|
|||
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
|
||||
@Param("param") SearchParam param
|
||||
);
|
||||
|
||||
|
||||
public void updateSample(@Param("platform") DictPlatform platform);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<select id="platformWithPage" resultType="map">
|
||||
select * from dict_platform where 1=1
|
||||
<if test="page_query != null and page_query != ''">
|
||||
and (platform_name like concat('%',#{page_query},'%') or platform_remark like concat('%',#{page_query},'%') or platform_alias like concat('%',#{page_query},'%'))
|
||||
and (platform_name like concat('%',#{page_query},'%') or platform_eng like concat('%',#{page_query},'%') or platform_alias like concat('%',#{page_query},'%'))
|
||||
</if>
|
||||
<if test="page_order != null and page_order != ''">
|
||||
ORDER BY ${page_order}
|
||||
|
|
@ -56,4 +56,7 @@
|
|||
order by v.platform_name
|
||||
</select>
|
||||
|
||||
<update id="updateSample">
|
||||
update sample_dataset set platform_type=#{platform.platform_name},platform_alias=#{platform.platform_alias} where platform_id=#{platform.tsy_id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
<!-- 航次统计 -->
|
||||
<select id="reportShipTotal" resultType="map">
|
||||
SELECT
|
||||
count(1) voyage_total,
|
||||
<if test="year != null">
|
||||
date_part('year', voyage_start_date) as year,
|
||||
</if>
|
||||
|
|
@ -128,33 +129,77 @@
|
|||
<select id="reportPlatformTotal" resultType="map">
|
||||
SELECT
|
||||
<if test="year != null">
|
||||
date_part('year', voyage_start_date) as year,
|
||||
date_part('year', r.voyage_start_date) as year,
|
||||
</if>
|
||||
sum(water_minutes) water_total,sum(job_minutes) job_total,
|
||||
COUNT ( DISTINCT diving_sn ) diving_total,
|
||||
COUNT ( DISTINCT driver_left ) + COUNT ( DISTINCT driver_left ) driver_member_total,
|
||||
COUNT ( DISTINCT ds.driver_unit_left ) unit_left,
|
||||
COUNT ( DISTINCT ds.driver_unit_right ) unit_right,
|
||||
COUNT ( DISTINCT ds.driver_unit_left ) + COUNT ( DISTINCT ds.driver_unit_right ) unit_total,
|
||||
COUNT ( DISTINCT dataset_name ) dataset_total
|
||||
sum(ds.water_minutes) water_total,
|
||||
sum(ds.job_minutes) job_total,
|
||||
COUNT(DISTINCT ds.diving_sn) diving_total,
|
||||
COUNT(DISTINCT all_drivers.person_name) driver_member_total,
|
||||
COUNT(DISTINCT all_drivers.unit_name) unit_total,
|
||||
COUNT(DISTINCT ds.dataset_name) dataset_total
|
||||
FROM
|
||||
sample_dataset ds,
|
||||
voyage_reg r
|
||||
voyage_reg r,
|
||||
(
|
||||
SELECT
|
||||
voyage_id,
|
||||
driver_left AS person_name,
|
||||
driver_unit_left AS unit_name
|
||||
FROM
|
||||
sample_dataset s,
|
||||
voyage_reg r
|
||||
WHERE
|
||||
r.tsy_id = s.voyage_id
|
||||
AND platform_type IN (${platform_type})
|
||||
AND driver_left IS NOT NULL
|
||||
<if test="platform_name != null and platform_name!=''">
|
||||
AND platform_name = #{platform_name}
|
||||
</if>
|
||||
<if test="start != null">
|
||||
AND voyage_start_date >= #{start}
|
||||
</if>
|
||||
<if test="end != null">
|
||||
AND voyage_start_date <= #{end}
|
||||
</if>
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
voyage_id,
|
||||
driver_right AS person_name,
|
||||
driver_unit_right AS unit_name
|
||||
FROM
|
||||
sample_dataset s,
|
||||
voyage_reg r
|
||||
WHERE
|
||||
r.tsy_id = s.voyage_id
|
||||
AND platform_type IN (${platform_type})
|
||||
AND driver_right IS NOT NULL
|
||||
<if test="platform_name != null and platform_name!=''">
|
||||
AND platform_name = #{platform_name}
|
||||
</if>
|
||||
<if test="start != null">
|
||||
AND voyage_start_date >= #{start}
|
||||
</if>
|
||||
<if test="end != null">
|
||||
AND voyage_start_date <= #{end}
|
||||
</if>
|
||||
) all_drivers
|
||||
WHERE
|
||||
ds.voyage_id = r.tsy_id
|
||||
and platform_type in
|
||||
(${platform_type})
|
||||
AND ds.voyage_id = all_drivers.voyage_id
|
||||
AND platform_type IN (${platform_type})
|
||||
<if test="platform_name != null and platform_name!=''">
|
||||
and platform_name = #{platform_name}
|
||||
AND platform_name = #{platform_name}
|
||||
</if>
|
||||
<if test="start != null">
|
||||
and voyage_start_date >= #{start}
|
||||
AND voyage_start_date >= #{start}
|
||||
</if>
|
||||
<if test="end != null">
|
||||
and voyage_start_date <= #{end}
|
||||
AND voyage_start_date <= #{end}
|
||||
</if>
|
||||
<if test="year != null and year != ''">
|
||||
group by date_part('year', voyage_start_date)
|
||||
GROUP BY date_part('year', r.voyage_start_date)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
|
@ -309,7 +354,7 @@
|
|||
SELECT
|
||||
m.member_unit,
|
||||
m.member_name,
|
||||
COUNT(1) drving_total,
|
||||
COUNT(distinct diving_sn) drving_total,
|
||||
MIN(voyage_start_date) min_drving_date
|
||||
FROM
|
||||
voyage_reg r,
|
||||
|
|
@ -319,10 +364,10 @@
|
|||
r.tsy_id = m.voyage_id
|
||||
AND d.voyage_id = r.tsy_id
|
||||
AND (
|
||||
d.driver_unit_left = m.member_unit
|
||||
AND d.driver_left = m.member_name
|
||||
OR d.driver_unit_right = m.member_unit
|
||||
AND d.driver_right = m.member_name
|
||||
(d.driver_unit_left = m.member_unit
|
||||
AND d.driver_left = m.member_name)
|
||||
OR (d.driver_unit_right = m.member_unit
|
||||
AND d.driver_right = m.member_name)
|
||||
)
|
||||
GROUP BY
|
||||
m.member_unit,
|
||||
|
|
@ -422,7 +467,7 @@
|
|||
SELECT
|
||||
m.member_unit,
|
||||
m.member_name,
|
||||
COUNT(1) drving_total,
|
||||
COUNT(distinct diving_sn) drving_total,
|
||||
MIN(voyage_start_date) min_drving_date
|
||||
FROM
|
||||
voyage_reg r,
|
||||
|
|
@ -432,10 +477,10 @@
|
|||
r.tsy_id = m.voyage_id
|
||||
AND d.voyage_id = r.tsy_id
|
||||
AND (
|
||||
d.driver_unit_left = m.member_unit
|
||||
AND d.driver_left = m.member_name
|
||||
OR d.driver_unit_right = m.member_unit
|
||||
AND d.driver_right = m.member_name
|
||||
(d.driver_unit_left = m.member_unit
|
||||
AND d.driver_left = m.member_name)
|
||||
OR (d.driver_unit_right = m.member_unit
|
||||
AND d.driver_right = m.member_name)
|
||||
)
|
||||
GROUP BY
|
||||
m.member_unit,
|
||||
|
|
|
|||
Loading…
Reference in New Issue