Compare commits
2 Commits
981724c32c
...
03b229693e
| Author | SHA1 | Date |
|---|---|---|
|
|
03b229693e | |
|
|
e41a4b5e0b |
|
|
@ -1,3 +1,52 @@
|
|||
<<<<<<< HEAD
|
||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
/build
|
||||
/tmp
|
||||
/out-tsc
|
||||
# Only exists if Bazel was run
|
||||
/bazel-out
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
# profiling files
|
||||
chrome-profiler-events*.json
|
||||
speed-measure-plugin*.json
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
/.angular
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
.history/*
|
||||
|
||||
# misc
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
testem.log
|
||||
/typings
|
||||
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
=======
|
||||
# This file tells git to ignore certain files and directories when committing changes.
|
||||
lib/
|
||||
build/
|
||||
|
|
@ -11,3 +60,4 @@ build/
|
|||
*.sln
|
||||
|
||||
*.class
|
||||
>>>>>>> 981724c32c499fc85fb8bb4b3be0c7809a2325ae
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
AppDebug=true
|
||||
AppParamHelper=cn.tsy.idsse.dsds.helper.DSDSParamHelper
|
||||
AppDatabaseStdout=Active
|
||||
AppListener=cn.tsy.idsse.dsds.control.DSDSInitializeLisener
|
||||
AppName=DSDS2024Server
|
||||
Binary file not shown.
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.tsy.data.idsse.dsds.mapper.dict.DictDataMapper">
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="dataWithPage" resultType="map">
|
||||
select * from dict_data where 1=1
|
||||
<if test="query != null and query != ''">
|
||||
and (data_name like concat('%',#{query},'%') or data_remark like concat('%',#{query},'%') or data_alias like concat('%',#{query},'%'))
|
||||
</if>
|
||||
<if test="order != null and order != ''">
|
||||
ORDER BY ${order}
|
||||
</if>
|
||||
<if test="type != null and (type == 'DESC')">
|
||||
DESC
|
||||
</if>
|
||||
</select>
|
||||
<select id="searchWithPage" resultType="map">
|
||||
select v.tsy_id id,v.data_name name,v.data_alias value from dict_data v
|
||||
<!-- 如果有平台类型,需要去查找有平台类型的航次 -->
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
,(select distinct data_id from sample_dataset where voyage_name=#{param.voyage_name}) p0
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
,(select distinct data_id from sample_dataset where platform_type=#{param.platform_type}) p1
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
,(select distinct data_id from sample_dataset where platform_name=#{param.platform_name}) p2
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
,(select distinct data_id from sample_dataset where equipment_type=#{param.equipment_type}) p3
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
,(select distinct data_id from sample_dataset where data_type=#{param.data_type}) p4
|
||||
</if>
|
||||
where 1=1
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
and p0.data_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
and p1.data_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
and p2.data_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
and p3.data_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
and p4.data_id = v.tsy_id
|
||||
</if>
|
||||
order by v.data_name
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Binary file not shown.
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.tsy.data.idsse.dsds.mapper.dict.DictEquipmentMapper">
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="equipmentWithPage" resultType="map">
|
||||
select * from dict_equipment where 1=1
|
||||
<if test="query != null and query != ''">
|
||||
and (equipment_name like concat('%',#{query},'%') or equipment_remark like concat('%',#{query},'%') or equipment_alias like concat('%',#{query},'%'))
|
||||
</if>
|
||||
<if test="order != null and order != ''">
|
||||
ORDER BY ${order}
|
||||
</if>
|
||||
<if test="type != null and (type == 'DESC')">
|
||||
DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="searchWithPage" resultType="map">
|
||||
select v.tsy_id id,v.equipment_name name,v.equipment_alias value from DICT_EQUIPMENT v
|
||||
<!-- 如果有平台类型,需要去查找有平台类型的航次 -->
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
,(select distinct equipment_id from sample_dataset where voyage_name=#{param.voyage_name}) p0
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
,(select distinct equipment_id from sample_dataset where platform_type=#{param.platform_type}) p1
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
,(select distinct equipment_id from sample_dataset where platform_name=#{param.platform_name}) p2
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
,(select distinct equipment_id from sample_dataset where equipment_type=#{param.equipment_type}) p3
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
,(select distinct equipment_id from sample_dataset where data_type=#{param.data_type}) p4
|
||||
</if>
|
||||
where 1=1
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
and p0.equipment_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
and p1.equipment_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
and p2.equipment_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
and p3.equipment_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
and p4.equipment_id = v.tsy_id
|
||||
</if>
|
||||
order by v.equipment_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Binary file not shown.
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.tsy.data.idsse.dsds.mapper.dict.DictPlatformMapper">
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="platformWithPage" resultType="map">
|
||||
select * from dict_platform where 1=1
|
||||
<if test="query != null and query != ''">
|
||||
and (platform_name like concat('%',#{query},'%') or platform_remark like concat('%',#{query},'%') or platform_alias like concat('%',#{query},'%'))
|
||||
</if>
|
||||
<if test="order != null and order != ''">
|
||||
ORDER BY ${order}
|
||||
</if>
|
||||
<if test="type != null and (type == 'DESC')">
|
||||
DESC
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="searchWithPage" resultType="map">
|
||||
select v.tsy_id id,v.platform_name name,v.platform_alias value from dict_platform v
|
||||
<!-- 如果有平台类型,需要去查找有平台类型的航次 -->
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
,(select distinct platform_id from sample_dataset where voyage_name=#{param.voyage_name}) p0
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
,(select distinct platform_id from sample_dataset where platform_type=#{param.platform_type}) p1
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
,(select distinct platform_id from sample_dataset where platform_name=#{param.platform_name}) p2
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
,(select distinct platform_id from sample_dataset where equipment_type=#{param.equipment_type}) p3
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
,(select distinct platform_id from sample_dataset where data_type=#{param.data_type}) p4
|
||||
</if>
|
||||
where 1=1
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
and p0.platform_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
and p1.platform_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
and p2.platform_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
and p3.platform_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
and p4.platform_id = v.tsy_id
|
||||
</if>
|
||||
order by v.platform_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Binary file not shown.
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper">
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="voyageWithPage" resultType="map">
|
||||
select r.*,member_total from voyage_reg r
|
||||
left join (select voyage_id,count(1) member_total from voyage_member group by voyage_id) m
|
||||
on r.tsy_id = m.voyage_id
|
||||
where 1=1
|
||||
<if test="query != null and query != ''">
|
||||
and (voyage_name like concat('%',#{query},'%') or voyage_officer like concat('%',#{query},'%')
|
||||
or voyage_officer like concat('%',#{query},'%') or voyage_remark like concat('%',#{query},'%'))
|
||||
</if>
|
||||
<if test="order != null and order != ''">
|
||||
ORDER BY ${order}
|
||||
</if>
|
||||
<if test="type != null and (type == 'DESC')">
|
||||
DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="searchWithPage" resultType="map">
|
||||
select v.tsy_id id,v.voyage_name name from voyage_reg v
|
||||
<!-- 如果有平台类型,需要去查找有平台类型的航次 -->
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
,(select distinct voyage_id from sample_dataset where platform_type=#{param.platform_type}) p1
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
,(select distinct voyage_id from sample_dataset where platform_name=#{param.platform_name}) p2
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
,(select distinct voyage_id from sample_dataset where equipment_type=#{param.equipment_type}) p3
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
,(select distinct voyage_id from sample_dataset where sample_type=#{param.sample_type}) p4
|
||||
</if>
|
||||
where 1=1
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
and p1.voyage_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
and p2.voyage_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
and p3.voyage_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
and p4.voyage_id = v.tsy_id
|
||||
</if>
|
||||
order by v.voyage_name
|
||||
</select>
|
||||
|
||||
<select id="totalVoyage" resultType="map">
|
||||
SELECT count(1) voyage_total,sum(DATEDIFF(voyage_end_date, VOYAGE_START_DATE)) day_total,sum(voyage_mileage) mileage_total from voyage_reg where 1=1
|
||||
<if test="start_date != null ">
|
||||
and voyage_start_date >= #{start_date}
|
||||
</if>
|
||||
|
||||
<if test="end_date != null ">
|
||||
and voyage_end_date <= #{end_date}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
AppDebug=true
|
||||
AppParamHelper=cn.tsy.idsse.dsds.helper.DSDSParamHelper
|
||||
AppDatabaseStdout=InActive
|
||||
AppDatabaseStdout=Active
|
||||
AppListener=cn.tsy.idsse.dsds.control.DSDSInitializeLisener
|
||||
AppName=DSDS2024Server
|
||||
|
|
@ -7,6 +7,7 @@ import cn.hme.framework.jdbc.constant.SqlProviderConstant;
|
|||
import cn.hme.framework.jdbc.mapper.IHmeMapper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.tsy.data.idsse.dsds.model.dict.DictData;
|
||||
import cn.tsy.idsse.dsds.control.search.SearchParam;
|
||||
|
||||
@HmeMapper
|
||||
public interface DictDataMapper extends IHmeMapper<DictData> {
|
||||
|
|
@ -19,4 +20,14 @@ public interface DictDataMapper extends IHmeMapper<DictData> {
|
|||
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type
|
||||
);
|
||||
|
||||
public Pageable searchWithPage(
|
||||
@Param(SqlProviderConstant.SQL_PAGE_GROUP) Integer group,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_START) Integer start,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_LIMIT) Integer limit,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_QUERY) String query,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type,
|
||||
@Param("param") SearchParam param
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,42 @@
|
|||
DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="searchWithPage" resultType="map">
|
||||
select v.tsy_id id,v.data_name name,v.data_alias value from dict_data v
|
||||
<!-- 如果有平台类型,需要去查找有平台类型的航次 -->
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
,(select distinct data_id from sample_dataset where voyage_name=#{param.voyage_name}) p0
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
,(select distinct data_id from sample_dataset where platform_type=#{param.platform_type}) p1
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
,(select distinct data_id from sample_dataset where platform_name=#{param.platform_name}) p2
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
,(select distinct data_id from sample_dataset where equipment_type=#{param.equipment_type}) p3
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
,(select distinct data_id from sample_dataset where data_type=#{param.data_type}) p4
|
||||
</if>
|
||||
where 1=1
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
and p0.data_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
and p1.data_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
and p2.data_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
and p3.data_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
and p4.data_id = v.tsy_id
|
||||
</if>
|
||||
order by v.data_name
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -7,6 +7,7 @@ import cn.hme.framework.jdbc.constant.SqlProviderConstant;
|
|||
import cn.hme.framework.jdbc.mapper.IHmeMapper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.tsy.data.idsse.dsds.model.dict.DictEquipment;
|
||||
import cn.tsy.idsse.dsds.control.search.SearchParam;
|
||||
|
||||
@HmeMapper
|
||||
public interface DictEquipmentMapper extends IHmeMapper<DictEquipment> {
|
||||
|
|
@ -18,4 +19,14 @@ public interface DictEquipmentMapper extends IHmeMapper<DictEquipment> {
|
|||
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type
|
||||
);
|
||||
|
||||
public Pageable searchWithPage(
|
||||
@Param(SqlProviderConstant.SQL_PAGE_GROUP) Integer group,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_START) Integer start,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_LIMIT) Integer limit,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_QUERY) String query,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type,
|
||||
@Param("param") SearchParam param
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,5 +19,41 @@
|
|||
</select>
|
||||
|
||||
|
||||
<select id="searchWithPage" resultType="map">
|
||||
select v.tsy_id id,v.equipment_name name,v.equipment_alias value from DICT_EQUIPMENT v
|
||||
<!-- 如果有平台类型,需要去查找有平台类型的航次 -->
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
,(select distinct equipment_id from sample_dataset where voyage_name=#{param.voyage_name}) p0
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
,(select distinct equipment_id from sample_dataset where platform_type=#{param.platform_type}) p1
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
,(select distinct equipment_id from sample_dataset where platform_name=#{param.platform_name}) p2
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
,(select distinct equipment_id from sample_dataset where equipment_type=#{param.equipment_type}) p3
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
,(select distinct equipment_id from sample_dataset where data_type=#{param.data_type}) p4
|
||||
</if>
|
||||
where 1=1
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
and p0.equipment_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
and p1.equipment_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
and p2.equipment_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
and p3.equipment_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
and p4.equipment_id = v.tsy_id
|
||||
</if>
|
||||
order by v.equipment_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -7,6 +7,7 @@ import cn.hme.framework.jdbc.constant.SqlProviderConstant;
|
|||
import cn.hme.framework.jdbc.mapper.IHmeMapper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.tsy.data.idsse.dsds.model.dict.DictPlatform;
|
||||
import cn.tsy.idsse.dsds.control.search.SearchParam;
|
||||
|
||||
@HmeMapper
|
||||
public interface DictPlatformMapper extends IHmeMapper<DictPlatform> {
|
||||
|
|
@ -18,4 +19,14 @@ public interface DictPlatformMapper extends IHmeMapper<DictPlatform> {
|
|||
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type
|
||||
);
|
||||
|
||||
public Pageable searchWithPage(
|
||||
@Param(SqlProviderConstant.SQL_PAGE_GROUP) Integer group,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_START) Integer start,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_LIMIT) Integer limit,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_QUERY) String query,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type,
|
||||
@Param("param") SearchParam param
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,41 @@
|
|||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="searchWithPage" resultType="map">
|
||||
select v.tsy_id id,v.platform_name name,v.platform_alias value from dict_platform v
|
||||
<!-- 如果有平台类型,需要去查找有平台类型的航次 -->
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
,(select distinct platform_id from sample_dataset where voyage_name=#{param.voyage_name}) p0
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
,(select distinct platform_id from sample_dataset where platform_type=#{param.platform_type}) p1
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
,(select distinct platform_id from sample_dataset where platform_name=#{param.platform_name}) p2
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
,(select distinct platform_id from sample_dataset where equipment_type=#{param.equipment_type}) p3
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
,(select distinct platform_id from sample_dataset where data_type=#{param.data_type}) p4
|
||||
</if>
|
||||
where 1=1
|
||||
<if test="param.voyage_name != null and param.voyage_name != ''">
|
||||
and p0.platform_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
and p1.platform_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
and p2.platform_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
and p3.platform_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
and p4.platform_id = v.tsy_id
|
||||
</if>
|
||||
order by v.platform_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
package cn.tsy.data.idsse.dsds.mapper.sample;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import cn.hme.framework.jdbc.annotation.HmeMapper;
|
||||
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
|
||||
import cn.hme.framework.jdbc.mapper.IHmeMapper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleReg;
|
||||
|
||||
@HmeMapper
|
||||
public interface SampleRegMapper extends IHmeMapper<SampleReg> {
|
||||
public Pageable sampleWithPage(
|
||||
@Param(SqlProviderConstant.SQL_PAGE_GROUP) Integer group,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_START) Integer start,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_LIMIT) Integer limit,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_QUERY) String query,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type
|
||||
);
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.tsy.data.idsse.dsds.mapper.sample.SampleRegMapper">
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="sampleWithPage" resultType="map">
|
||||
select * from sample_reg where 1=1
|
||||
<if test="query != null and query != ''">
|
||||
and (sample_name like concat('%',#{query},'%') or voyage_name like concat('%',#{query},'%')
|
||||
or platform_name like concat('%',#{query},'%') or sample_remark like concat('%',#{query},'%'))
|
||||
</if>
|
||||
<if test="order != null and order != ''">
|
||||
ORDER BY ${order}
|
||||
</if>
|
||||
<if test="type != null and (type == 'DESC')">
|
||||
DESC
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -11,6 +11,7 @@ import cn.hme.framework.jdbc.constant.SqlProviderConstant;
|
|||
import cn.hme.framework.jdbc.mapper.IHmeMapper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.tsy.data.idsse.dsds.model.voyage.VoyageReg;
|
||||
import cn.tsy.idsse.dsds.control.search.SearchParam;
|
||||
|
||||
@HmeMapper
|
||||
public interface VoyageRegMapper extends IHmeMapper<VoyageReg> {
|
||||
|
|
@ -24,5 +25,15 @@ public interface VoyageRegMapper extends IHmeMapper<VoyageReg> {
|
|||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type
|
||||
);
|
||||
|
||||
public Pageable searchWithPage(
|
||||
@Param(SqlProviderConstant.SQL_PAGE_GROUP) Integer group,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_START) Integer start,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_LIMIT) Integer limit,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_QUERY) String query,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_ORDER) String order,
|
||||
@Param(SqlProviderConstant.SQL_PAGE_TYPE) String type,
|
||||
@Param("param") SearchParam param
|
||||
);
|
||||
|
||||
public List<Map<String,Object>> totalVoyage(@Param("start_date") LocalDate start_date,@Param("end_date") LocalDate end_date);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,37 @@
|
|||
</select>
|
||||
|
||||
|
||||
<select id="searchWithPage" resultType="map">
|
||||
select v.tsy_id id,v.voyage_name name from voyage_reg v
|
||||
<!-- 如果有平台类型,需要去查找有平台类型的航次 -->
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
,(select distinct voyage_id from sample_dataset where platform_type=#{param.platform_type}) p1
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
,(select distinct voyage_id from sample_dataset where platform_name=#{param.platform_name}) p2
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
,(select distinct voyage_id from sample_dataset where equipment_type=#{param.equipment_type}) p3
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
,(select distinct voyage_id from sample_dataset where sample_type=#{param.sample_type}) p4
|
||||
</if>
|
||||
where 1=1
|
||||
<if test="param.platform_type != null and param.platform_type != ''">
|
||||
and p1.voyage_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.platform_name != null and param.platform_name != ''">
|
||||
and p2.voyage_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.equipment_type != null and param.equipment_type != ''">
|
||||
and p3.voyage_id = v.tsy_id
|
||||
</if>
|
||||
<if test="param.data_type != null and param.data_type != ''">
|
||||
and p4.voyage_id = v.tsy_id
|
||||
</if>
|
||||
order by v.voyage_name
|
||||
</select>
|
||||
|
||||
<select id="totalVoyage" resultType="map">
|
||||
SELECT count(1) voyage_total,sum(DATEDIFF(voyage_end_date, VOYAGE_START_DATE)) day_total,sum(voyage_mileage) mileage_total from voyage_reg where 1=1
|
||||
<if test="start_date != null ">
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
package cn.tsy.idsse.dsds.control.sample;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import cn.hme.framework.helper.excel.ExcelReaderHelper;
|
||||
import cn.hme.framework.helper.lang.StringHelper;
|
||||
import cn.hme.framework.jdbc.provider.page.Pageable;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleLineMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleRegMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleStationMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleLine;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleReg;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleStation;
|
||||
import cn.tsy.idsse.dsds.helper.DSDSWebHelper;
|
||||
import cn.tsy.idsse.dsds.service.sample.SampleRegService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sample/reg")
|
||||
@CrossOrigin
|
||||
public class SampleRegControl extends AjaxControl {
|
||||
|
||||
@Autowired
|
||||
private SampleRegMapper mSample;
|
||||
@Autowired
|
||||
private SampleLineMapper mLine;
|
||||
@Autowired
|
||||
private SampleStationMapper mStation;
|
||||
|
||||
|
||||
@Autowired
|
||||
private SampleRegService sSample;
|
||||
|
||||
@RequestMapping("page.htm")
|
||||
public Ajax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
|
||||
order = StringHelper.hasValue(order) ? order : "create_time";
|
||||
type = StringHelper.hasValue(type) ? type : "DESC";
|
||||
Pageable page = this.mSample.sampleWithPage(group, start, limit, query, order, type);
|
||||
return new Ajax(page);
|
||||
}
|
||||
|
||||
@RequestMapping("edit.htm")
|
||||
public Ajax edit(SampleReg sample, SampleStation satation, SampleLine line) {
|
||||
this.sSample.editSample(sample, satation, line, DSDSWebHelper.getFrameOptr(true));
|
||||
return new Ajax(sample);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("line/find.htm")
|
||||
public Ajax findLine(int sample_id) {
|
||||
return new Ajax(this.mLine.findWithColumn("sample_id",sample_id));
|
||||
}
|
||||
|
||||
@RequestMapping("station/find.htm")
|
||||
public Ajax findStation(int sample_id) {
|
||||
return new Ajax(this.mStation.findWithColumn("sample_id",sample_id));
|
||||
}
|
||||
|
||||
@RequestMapping("delete.htm")
|
||||
public Ajax delete(int tsy_id) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
this.sSample.deleteSample(tsy_id);
|
||||
return new Ajax();
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@RequestMapping("upload.htm")
|
||||
public Ajax upload(MultipartFile file) {
|
||||
DSDSWebHelper.getFrameOptr(true);
|
||||
List<List<String>> values = ExcelReaderHelper.readSheet(file, 2, 32);
|
||||
if (values.size() == 0)
|
||||
throw new BusinessException("导入的文件中无有效数据,请检查!");
|
||||
return new Ajax();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,8 +6,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.hme.framework.helper.lang.CollectionHelper;
|
||||
import cn.hme.framework.helper.lang.StringHelper;
|
||||
import cn.hme.framework.web.control.Ajax;
|
||||
import cn.hme.framework.web.control.AjaxControl;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictDataMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictEquipmentMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictPlatformMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
||||
|
||||
@RestController
|
||||
|
|
@ -16,6 +20,12 @@ import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
|||
public class DSDSSearchControl extends AjaxControl {
|
||||
@Autowired
|
||||
private VoyageRegMapper mVoyage;
|
||||
@Autowired
|
||||
private DictPlatformMapper mPlatform;
|
||||
@Autowired
|
||||
private DictEquipmentMapper mEquipment;
|
||||
@Autowired
|
||||
private DictDataMapper mData;
|
||||
|
||||
@RequestMapping("page.htm")
|
||||
public Ajax page(Integer group, Integer limit, Integer start, String search_type, String order, String type, String return_type, String search_value, Integer[] ids) {
|
||||
|
|
@ -43,7 +53,7 @@ public class DSDSSearchControl extends AjaxControl {
|
|||
where = " and equipment_id in(" + CollectionHelper.join(ids, ",") + ") ";
|
||||
}
|
||||
} else if ("数据集名称".equals(search_type)) {
|
||||
where = " and (dataset_name like concat('%','" + search_value + "','%')) ";
|
||||
where = " and (dataset_name like concat('%','" + search_value + "','%')) ";
|
||||
} else if ("数据样品类型".equals(search_type)) {
|
||||
if (ids == null || ids.length < 1) {
|
||||
where = " and (data_type like concat('%','" + search_value + "','%') or data_alias like concat('%','" + search_value + "','%')) ";
|
||||
|
|
@ -55,12 +65,64 @@ public class DSDSSearchControl extends AjaxControl {
|
|||
}
|
||||
|
||||
if ("数据样品集".equals(return_type)) {
|
||||
String sql = "select t.* from (select file_total,d.* from sample_dataset d "
|
||||
+ " left join ("
|
||||
+ " select dataset_id,count(1) file_total from sample_line group by dataset_id "
|
||||
+ " union select dataset_id,count(1) file_total from sample_station group by dataset_id "
|
||||
+ " ) l"
|
||||
+ " on d.tsy_id=l.dataset_id) t,voyage_reg y where y.tsy_id=t.voyage_id " + where + " order by t.create_time desc";
|
||||
String sql = "select t.* from (select file_total,d.* from sample_dataset d " + " left join (" + " select dataset_id,count(1) file_total from sample_line group by dataset_id " + " union select dataset_id,count(1) file_total from sample_station group by dataset_id " + " ) l" + " on d.tsy_id=l.dataset_id) t,voyage_reg y where y.tsy_id=t.voyage_id " + where + " order by t.create_time desc";
|
||||
return new Ajax(this.mVoyage.pageRecordBySql(group, start, limit, sql));
|
||||
} else {
|
||||
// 航次
|
||||
String sql = "select t.* from voyage_reg t where tsy_id in (" + "select distinct t.voyage_id from sample_dataset t,voyage_reg y where y.tsy_id=t.voyage_id " + " " + where + ") order by t.create_time desc";
|
||||
return new Ajax(this.mVoyage.pageRecordBySql(group, start, limit, sql));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("mult.htm")
|
||||
public Ajax mult(String search_type, Integer group, Integer limit, Integer start, String order, String type, SearchParam param) {
|
||||
if ("航次名称".endsWith(search_type))
|
||||
return new Ajax(this.mVoyage.searchWithPage(group, start, limit, search_type, order, type, param));
|
||||
if ("平台类型".endsWith(search_type))
|
||||
return new Ajax(this.mPlatform.searchWithPage(group, start, limit, search_type, order, type, param));
|
||||
if ("设备类型".endsWith(search_type))
|
||||
return new Ajax(this.mEquipment.searchWithPage(group, start, limit, search_type, order, type, param));
|
||||
if ("数据样品类型".endsWith(search_type))
|
||||
return new Ajax(this.mData.searchWithPage(group, start, limit, search_type, order, type, param));
|
||||
return new Ajax();
|
||||
}
|
||||
|
||||
@RequestMapping("result.htm")
|
||||
public Ajax result(Integer group, Integer limit, Integer start, String order, String type, String return_type, String search_type, String search_value, SearchParam param) {
|
||||
|
||||
String where = "";
|
||||
if (StringHelper.hasValue(param.getVoyage_name()))
|
||||
where = " and t.voyage_name ='" + param.getVoyage_name() + "' ";
|
||||
if (StringHelper.hasValue(param.getPlatform_type()))
|
||||
where = " and platform_type ='" + param.getPlatform_type() + "' ";
|
||||
if (StringHelper.hasValue(param.getEquipment_type()))
|
||||
where = " and equipment_type ='" + param.getEquipment_type() + "' ";
|
||||
if (StringHelper.hasValue(param.getData_type()))
|
||||
where = " and data_type ='" + param.getData_type() + "' ";
|
||||
|
||||
if (StringHelper.hasValue(search_value)) {
|
||||
if ("航次名称".equals(search_type)) {
|
||||
where = " and t.voyage_name like concat('%','" + search_value + "','%') ";
|
||||
} else if ("平台类型".equals(search_type)) {
|
||||
where = " and (platform_type like concat('%','" + search_value + "','%') or platform_alias like concat('%','" + search_value + "','%')) ";
|
||||
} else if ("平台名称".equals(search_type)) {
|
||||
where = " and platform_name like concat('%','" + search_value + "','%') ";
|
||||
} else if ("设备类型".equals(search_type)) {
|
||||
where = " and (equipment_type like concat('%','" + search_value + "','%') or equipment_alias like concat('%','" + search_value + "','%')) ";
|
||||
} else if ("数据集名称".equals(search_type)) {
|
||||
where = " and (dataset_name like concat('%','" + search_value + "','%')) ";
|
||||
} else if ("数据样品类型".equals(search_type)) {
|
||||
where = " and (data_type like concat('%','" + search_value + "','%') or data_alias like concat('%','" + search_value + "','%')) ";
|
||||
} else if ("航次首席".equals(search_type)) {
|
||||
where = " and voyage_officer like concat('%','" + search_value + "','%') ";
|
||||
}
|
||||
}
|
||||
|
||||
if ("数据样品集".equals(return_type)) {
|
||||
String sql = "select t.* from (select file_total,d.* from sample_dataset d left join ( select dataset_id,count(1) file_total from sample_line group by dataset_id union select dataset_id,count(1) file_total from sample_station group by dataset_id ) l on d.tsy_id=l.dataset_id) t,voyage_reg y where y.tsy_id=t.voyage_id " +
|
||||
where + " order by t.create_time desc";
|
||||
return new Ajax(this.mVoyage.pageRecordBySql(group, start, limit, sql));
|
||||
} else {
|
||||
// 航次
|
||||
|
|
|
|||
|
|
@ -0,0 +1,105 @@
|
|||
package cn.tsy.idsse.dsds.control.search;
|
||||
|
||||
/*************************
|
||||
* 查询参数
|
||||
*
|
||||
* @author TsySoft
|
||||
* @create 2024-10-01 15:31:19
|
||||
* @version 1.0.0
|
||||
* @email revisit@126.com
|
||||
*
|
||||
*/
|
||||
public class SearchParam {
|
||||
|
||||
/*********************
|
||||
* 航次名称
|
||||
*/
|
||||
private String voyage_name;
|
||||
|
||||
/********************
|
||||
* 平台类型
|
||||
*/
|
||||
private String platform_type;
|
||||
|
||||
/******************
|
||||
* 平台名称
|
||||
*/
|
||||
private String platform_name;
|
||||
|
||||
/*******************
|
||||
* 设备类型
|
||||
*/
|
||||
private String equipment_type;
|
||||
|
||||
/*****************
|
||||
* 数据样品类型
|
||||
*/
|
||||
private String data_type;
|
||||
|
||||
/**************************
|
||||
* 数据集名称
|
||||
*/
|
||||
private String dataset_name;
|
||||
|
||||
/**********************
|
||||
* 航次首席
|
||||
*/
|
||||
private String voyage_officer;
|
||||
|
||||
public String getVoyage_name() {
|
||||
return voyage_name;
|
||||
}
|
||||
|
||||
public void setVoyage_name(String voyage_name) {
|
||||
this.voyage_name = voyage_name;
|
||||
}
|
||||
|
||||
public String getPlatform_type() {
|
||||
return platform_type;
|
||||
}
|
||||
|
||||
public void setPlatform_type(String platform_type) {
|
||||
this.platform_type = platform_type;
|
||||
}
|
||||
|
||||
public String getPlatform_name() {
|
||||
return platform_name;
|
||||
}
|
||||
|
||||
public void setPlatform_name(String platform_name) {
|
||||
this.platform_name = platform_name;
|
||||
}
|
||||
|
||||
public String getEquipment_type() {
|
||||
return equipment_type;
|
||||
}
|
||||
|
||||
public void setEquipment_type(String equipment_type) {
|
||||
this.equipment_type = equipment_type;
|
||||
}
|
||||
|
||||
public String getData_type() {
|
||||
return data_type;
|
||||
}
|
||||
|
||||
public void setData_type(String data_type) {
|
||||
this.data_type = data_type;
|
||||
}
|
||||
|
||||
public String getDataset_name() {
|
||||
return dataset_name;
|
||||
}
|
||||
|
||||
public void setDataset_name(String dataset_name) {
|
||||
this.dataset_name = dataset_name;
|
||||
}
|
||||
|
||||
public String getVoyage_officer() {
|
||||
return voyage_officer;
|
||||
}
|
||||
|
||||
public void setVoyage_officer(String voyage_officer) {
|
||||
this.voyage_officer = voyage_officer;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,294 +0,0 @@
|
|||
package cn.tsy.idsse.dsds.service.sample;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import cn.hme.data.model.frame.optr.FrameOptr;
|
||||
import cn.hme.framework.web.exception.BusinessException;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictDataMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictEquipmentMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.dict.DictPlatformMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleLineMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleRegMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.sample.SampleStationMapper;
|
||||
import cn.tsy.data.idsse.dsds.mapper.voyage.VoyageRegMapper;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleLine;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleReg;
|
||||
import cn.tsy.data.idsse.dsds.model.sample.SampleStation;
|
||||
|
||||
@Service
|
||||
public class SampleRegService {
|
||||
@Autowired
|
||||
private SampleRegMapper mReg;
|
||||
@Autowired
|
||||
private DictPlatformMapper mPlatform;
|
||||
@Autowired
|
||||
private DictEquipmentMapper mEquipment;
|
||||
@Autowired
|
||||
private DictDataMapper mData;
|
||||
@Autowired
|
||||
private VoyageRegMapper mVoyage;
|
||||
@Autowired
|
||||
private SampleLineMapper mLine;
|
||||
@Autowired
|
||||
private SampleStationMapper mStation;
|
||||
|
||||
/***********************
|
||||
* 增加或者修改
|
||||
*
|
||||
*/
|
||||
public void editSample(SampleReg sample, SampleStation satation, SampleLine line, FrameOptr optr) {
|
||||
// FrameAssertHelper.isNotNull(sample.getVoyage_id(), "航次号不能为空!");
|
||||
// FrameAssertHelper.isNotEmpty(sample.getPlatform_type(), "平台类型不能为空!");
|
||||
// FrameAssertHelper.isNotEmpty(sample.getPlatform_name(), "平台名称不能为空!");
|
||||
// FrameAssertHelper.isNotEmpty(sample.getDiving_name(), "潜次号不能为空!");
|
||||
// FrameAssertHelper.isNotNull(sample.getEquipment_id(), "设备类型不能为空!");
|
||||
// FrameAssertHelper.isNotNull(sample.getData_id(), "数据样品类型不能为空!");
|
||||
// FrameAssertHelper.isNotEmpty(sample.getJob_type(), "作业类型不能为空!");
|
||||
// // TS2-37-1_SY665_JXS_WW_
|
||||
// // 数据样品编号: 航次号_潜次号_设备类型_数据样品类型_作业序号
|
||||
// //
|
||||
// VoyageReg voyage = this.mVoyage.find(sample.getVoyage_id());
|
||||
// FrameAssertHelper.isNotNull(voyage, "未找到指定的航次信息,请检查!");
|
||||
// if (sample.getTsy_id() == null) {
|
||||
//
|
||||
// DictEquipment equipment = this.mEquipment.find(sample.getEquipment_id());
|
||||
// DictData data = this.mData.find(sample.getData_id());
|
||||
// sample.setCreate_time(LocalDateTime.now());
|
||||
// sample.setEquipment_type(equipment.getEquipment_name());
|
||||
// sample.setEquipment_alias(equipment.getEquipment_alias());
|
||||
// sample.setData_alias(data.getData_alias());
|
||||
// sample.setSample_type(data.getData_name());
|
||||
// sample.setVoyage_name(voyage.getVoyage_name());
|
||||
// // 新增,需要生成数据集和数据样品编号
|
||||
// String dataset_name = voyage.getVoyage_name() + "_" + sample.getDiving_name() + "_" + sample.getEquipment_alias() + "_" + sample.getData_alias();
|
||||
// // 找到序号
|
||||
// Integer total = this.mReg.selectCount(SqlQuery.create().eq("dataset_name", dataset_name));
|
||||
// String sample_code = "";
|
||||
// int seq = 1;
|
||||
// if (total == null || total - 0 == 0)
|
||||
// sample_code = dataset_name + "_01";
|
||||
// else {
|
||||
// seq = total + 1;
|
||||
// sample_code = dataset_name + "_" + StringHelper.leftPadding(seq + "", 2, '0');
|
||||
// }
|
||||
//
|
||||
// sample.setDataset_name(dataset_name);
|
||||
// sample.setSample_seq(seq);
|
||||
// sample.setSample_code(sample_code);
|
||||
// sample.setSample_name(sample_code);
|
||||
// this.mReg.insert(sample);
|
||||
// if (sample.getJob_type().equals(VoyageJobType.Line)) {
|
||||
// line.setSample_id(sample.getTsy_id());
|
||||
// this.mLine.insert(line);
|
||||
// }
|
||||
// if (sample.getJob_type().equals(VoyageJobType.Station)) {
|
||||
// satation.setSample_id(sample.getTsy_id());
|
||||
// this.mStation.insert(satation);
|
||||
// }
|
||||
// } else {
|
||||
// this.mReg.update(sample);
|
||||
// if (sample.getJob_type().equals(VoyageJobType.Line)) {
|
||||
// line.setSample_id(sample.getTsy_id());
|
||||
// this.mLine.update(line);
|
||||
// }
|
||||
// if (sample.getJob_type().equals(VoyageJobType.Station)) {
|
||||
// satation.setSample_id(sample.getTsy_id());
|
||||
// this.mStation.update(satation);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// public List<SampleReg> uploadSample(List<List<String>> values, FrameOptr optr) {
|
||||
// /****
|
||||
// * *航次名称 *平台类型 *平台名称 *潜次序号 布放经度 布放纬度 布放深度
|
||||
// * 入水时间 出水时间 左舷 右舷 主驾
|
||||
// * 坐底时间 抛载时间 回收时间
|
||||
// * *设备类型 设备序列号
|
||||
// * *作业类型 *样品类型 序号 采样时间 经度 纬度 深度 测线号 深度 开始经度 开始纬度 结束经度 结束纬度 开始时间 结束时间 备注 数据公开期限
|
||||
// */
|
||||
//
|
||||
// FrameAssertHelper.hasValue(values, "导入的文件中无有效数据,请检查!");
|
||||
// List<SampleReg> sampleArray = new ArrayList<>();
|
||||
// for (int i = 1; i < values.size(); i++) {
|
||||
// List<String> list = values.get(i);
|
||||
// if (list.get(0) == null || list.get(0).trim().length() == 0)
|
||||
// break;
|
||||
// // *航次名称 *平台类型 *平台名称 *潜次序号 布放经度 布放纬度 布放深度
|
||||
// // 入水时间 出水时间 左舷 右舷 主驾 坐底时间 抛载时间 回收时间
|
||||
// // *设备类型 设备序列号 *作业类型 *样品类型 文物器号
|
||||
// String voyage_name = list.get(0);
|
||||
// String platform_type = list.get(1);
|
||||
// String platform_name = list.get(2);
|
||||
// String diving_name = list.get(3);
|
||||
// String wiring_lon = list.get(4);
|
||||
// String wiring_lat = list.get(5);
|
||||
// String wiring_deep = list.get(6);
|
||||
// String water_in_time = list.get(7);
|
||||
// String water_out_time = list.get(8);
|
||||
// String driver_left = list.get(9);
|
||||
// String driver_right = list.get(10);
|
||||
// String driver_master = list.get(11);
|
||||
// String bottom_time = list.get(12);
|
||||
// String down_time = list.get(13);
|
||||
// String receive_time = list.get(14);
|
||||
// String equipment_type = list.get(15);
|
||||
// String equipment_sn = list.get(16);
|
||||
// String job_type = list.get(17);
|
||||
// String sample_type = list.get(18);
|
||||
// String antique_sn = list.get(19);
|
||||
// // 采样时间 经度 纬度 深度
|
||||
// String sampling_time = list.get(20);
|
||||
// String sampling_lon = list.get(21);
|
||||
// String sampling_lat = list.get(22);
|
||||
// String sampling_deep = list.get(23);
|
||||
// // 测线号 深度 开始经度 开始纬度 结束经度 结束纬度 开始时间 结束时间 备注 数据公开期限
|
||||
// String line_sn = list.get(24);
|
||||
// String line_deep = list.get(25);
|
||||
// String start_lon = list.get(26);
|
||||
// String start_lat = list.get(27);
|
||||
// String end_lon = list.get(28);
|
||||
// String end_lat = list.get(29);
|
||||
// String start_time = list.get(30);
|
||||
// String end_time = list.get(31);
|
||||
// String remark = list.get(32);
|
||||
// String data_role = list.get(33);
|
||||
//
|
||||
// SampleReg sa = new SampleReg();
|
||||
// VoyageReg voyage = this.mVoyage.findWithColumn("voyage_name", voyage_name);
|
||||
// if (voyage == null)
|
||||
// throwError(i, "航次[" + voyage_name + "]未找到,请先添加该航次");
|
||||
// sa.setVoyage_id(voyage.getTsy_id());
|
||||
// sa.setVoyage_name(voyage_name);
|
||||
// DictPlatform platform = this.mPlatform.findWithColumn("platform_name", platform_type);
|
||||
// if (platform == null)
|
||||
// throwError(i, "平台类型[" + platform_type + "]未找到,请先添加该平台类型");
|
||||
// sa.setPlatform_type(platform_type);
|
||||
// sa.setPlatform_name(platform_name);
|
||||
// DictEquipment equipment = this.mEquipment.findWithColumn("equipment_name", equipment_type);
|
||||
// if (equipment == null)
|
||||
// throwError(i, "设备类型[" + equipment_type + "]未找到,请先添加该设备类型");
|
||||
// sa.setEquipment_alias(equipment.getEquipment_alias());
|
||||
// sa.setEquipment_id(equipment.getTsy_id());
|
||||
// sa.setEquipment_type(equipment_type);
|
||||
// DictData data = this.mData.findWithColumn("data_name", sample_type);
|
||||
// if (data == null)
|
||||
// throwError(i, "数据样品类型[" + sample_type + "]未找到,请先添加该数据样品类型");
|
||||
// sa.setData_alias(data.getData_alias());
|
||||
// sa.setData_id(data.getTsy_id());
|
||||
// sa.setSample_type(sample_type);
|
||||
// sa.setDiving_name(diving_name);
|
||||
// sa.setEquipment_sn(equipment_sn);
|
||||
//
|
||||
// sa.setCreate_time(LocalDateTime.now());
|
||||
// // 新增,需要生成数据集和数据样品编号
|
||||
// String dataset_name = voyage.getVoyage_name() + "_" + diving_name + "_" + sa.getEquipment_alias() + "_" + sa.getData_alias();
|
||||
// // 找到序号
|
||||
// Integer total = this.mReg.selectCount(SqlQuery.create().eq("dataset_name", dataset_name));
|
||||
// String sample_code = "";
|
||||
// int seq = 1;
|
||||
// if (total == null || total - 0 == 0)
|
||||
// sample_code = dataset_name + "_01";
|
||||
// else {
|
||||
// seq = total + 1;
|
||||
// sample_code = dataset_name + StringHelper.leftPadding(seq + "", 2, '0');
|
||||
// }
|
||||
// sa.setDataset_name(dataset_name);
|
||||
// sa.setSample_seq(seq);
|
||||
// sa.setSample_code(sample_code);
|
||||
// if (StringHelper.hasValue(antique_sn))
|
||||
// sa.setAntique_sn(antique_sn);
|
||||
// if (StringHelper.hasValue(remark))
|
||||
// sa.setSample_remark(remark);
|
||||
// sa.setJob_type(job_type);
|
||||
// SampleLine line = new SampleLine();
|
||||
// SampleStation st = new SampleStation();
|
||||
// if (StringHelper.isEmpty(job_type))
|
||||
// throwError(i, "作业类型为空,请检查!");
|
||||
// if (VoyageJobType.Line.equals(job_type)) {
|
||||
// if (StringHelper.hasValue(line_sn))
|
||||
// line.setLine_sn(line_sn);
|
||||
// if (StringHelper.hasValue(start_lon))
|
||||
// line.setStart_lon(checkValue(start_lon));
|
||||
// if (StringHelper.hasValue(start_lat))
|
||||
// line.setStart_lat(checkValue(start_lat));
|
||||
// if (StringHelper.hasValue(end_lon))
|
||||
// line.setEnd_lon(checkValue(end_lon));
|
||||
// if (StringHelper.hasValue(end_lat))
|
||||
// line.setEnd_lat(checkValue(end_lat));
|
||||
// if (StringHelper.hasValue(start_time))
|
||||
// line.setStart_time(LocalDateHelper.parseDateTime(start_time));
|
||||
// if (StringHelper.hasValue(end_time))
|
||||
// line.setEnd_time(LocalDateHelper.parseDateTime(end_time));
|
||||
//
|
||||
// } else if (VoyageJobType.Station.equals(job_type)) {
|
||||
// if (StringHelper.hasValue(wiring_lon))
|
||||
// st.setWiring_lon(checkValue(wiring_lon));
|
||||
// if (StringHelper.hasValue(wiring_lat))
|
||||
// st.setWiring_lat(checkValue(wiring_lat));
|
||||
// if (StringHelper.hasValue(wiring_deep))
|
||||
// st.setWiring_deep(wiring_deep);
|
||||
//
|
||||
// if (StringHelper.hasValue(water_in_time))
|
||||
// st.setWater_in_time(LocalDateHelper.parseDateTime(water_in_time));
|
||||
// if (StringHelper.hasValue(water_out_time))
|
||||
// st.setWater_out_time(LocalDateHelper.parseDateTime(water_out_time));
|
||||
//
|
||||
// if (StringHelper.hasValue(driver_left))
|
||||
// st.setDriver_left(driver_left);
|
||||
// if (StringHelper.hasValue(driver_right))
|
||||
// st.setDriver_right(driver_right);
|
||||
// if (StringHelper.hasValue(driver_master))
|
||||
// st.setDriver_master(driver_master);
|
||||
//
|
||||
// if (StringHelper.hasValue(bottom_time))
|
||||
// st.setBottom_time(LocalDateHelper.parseDateTime(bottom_time));
|
||||
// if (StringHelper.hasValue(down_time))
|
||||
// st.setDown_time(LocalDateHelper.parseDateTime(down_time));
|
||||
// if (StringHelper.hasValue(receive_time))
|
||||
// st.setReceive_time(LocalDateHelper.parseDateTime(receive_time));
|
||||
// if (StringHelper.hasValue(sampling_time))
|
||||
// st.setSampling_time(LocalDateHelper.parseDateTime(sampling_time));
|
||||
// if (StringHelper.hasValue(sampling_lat))
|
||||
// st.setSampling_lat(checkValue(sampling_lat));
|
||||
// if (StringHelper.hasValue(sampling_lon))
|
||||
// st.setSampling_lon(checkValue(sampling_lon));
|
||||
// if (StringHelper.hasValue(sampling_deep))
|
||||
// st.setSampling_deep(sampling_deep);
|
||||
// } else
|
||||
// throwError(i, "作业类型[" + job_type + "]必须为测线作业或者站位作业!");
|
||||
//
|
||||
// this.editSample(sa, st, line, optr);
|
||||
// sampleArray.add(sa);
|
||||
// }
|
||||
// return new ArrayList<>();
|
||||
// }
|
||||
|
||||
/****************
|
||||
* 删除数据样品
|
||||
*
|
||||
*/
|
||||
public void deleteSample(int sample_id) {
|
||||
/****************
|
||||
* @todo 判断是否能实际删除
|
||||
*/
|
||||
this.mLine.deleteByColumn("sample_id", sample_id);
|
||||
this.mStation.deleteByColumn("sample_id", sample_id);
|
||||
this.mReg.deleteByKey(sample_id);
|
||||
}
|
||||
|
||||
public void throwError(int row, String msg) {
|
||||
throw new BusinessException("数据样品信息导入失败->第[" + (row + 3) + "]行:" + msg);
|
||||
|
||||
}
|
||||
|
||||
// 经纬度保留4位
|
||||
public String checkValue(String value) {
|
||||
try {
|
||||
return String.format("%.4f", Double.parseDouble(value));
|
||||
} catch (Exception e) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue