新增潜次列表(列出所有已经上传了轨迹的潜次),访问路径 sample/diving/list.htm

This commit is contained in:
xiaoqing 2025-12-02 14:30:41 +08:00
parent 608098e40f
commit bab37f89e9
130 changed files with 9909 additions and 9908 deletions

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Tomcat v10.1">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="build/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Tomcat v10.1">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="build/classes"/>
</classpath>

View File

@ -1,31 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DSDSServer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DSDSServer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

View File

@ -1,15 +1,15 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=21
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=21

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="DSDSServer">
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<property name="context-root" value="ds"/>
<property name="java-output-path" value="/DSDSServer/build/classes"/>
</wb-module>
</project-modules>
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="DSDSServer">
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<property name="context-root" value="ds"/>
<property name="java-output-path" value="/DSDSServer/build/classes"/>
</wb-module>
</project-modules>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Tomcat v10.1"/>
<fixed facet="jst.web"/>
<fixed facet="java"/>
<fixed facet="wst.jsdt.web"/>
<installed facet="jst.web" version="5.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="21"/>
</faceted-project>
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Tomcat v10.1"/>
<fixed facet="jst.web"/>
<fixed facet="java"/>
<fixed facet="wst.jsdt.web"/>
<installed facet="jst.web" version="5.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="21"/>
</faceted-project>

View File

@ -1,5 +1,5 @@
AppDebug=true
AppTrace=true
AppParamHelper=cn.tsy.cas.idsse.dsds.helper.DsdsParamHelper
AppListener=cn.tsy.cas.idsse.dsds.control.DSDSInitializeListener
AppDebug=true
AppTrace=true
AppParamHelper=cn.tsy.cas.idsse.dsds.helper.DSDSParamHelper
AppListener=cn.tsy.cas.idsse.dsds.control.DSDSInitializeListener
AppName=DSDSServer

View File

@ -1,59 +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.cas.idsse.dsds.mapper.dict.IDictDataMapper">
<!-- 分页查询 -->
<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},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>
<?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.cas.idsse.dsds.mapper.dict.IDictDataMapper">
<!-- 分页查询 -->
<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},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>

View File

@ -1,61 +1,61 @@
<?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.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper">
<!-- 分页查询 -->
<select id="equipmentWithPage" resultType="map">
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_alias like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>
<?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.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper">
<!-- 分页查询 -->
<select id="equipmentWithPage" resultType="map">
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_alias like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>

View File

@ -1,22 +1,22 @@
<?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.cas.idsse.dsds.mapper.dict.IDictFundingMapper">
<!-- 分页查询 -->
<select id="fundingWithPage" resultType="map">
select * from dict_funding where 1=1
<if test="page_query != null and page_query != ''">
and (funding_name like concat('%',#{page_query},'%') or funding_eng like concat('%',#{page_query},'%') )
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<?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.cas.idsse.dsds.mapper.dict.IDictFundingMapper">
<!-- 分页查询 -->
<select id="fundingWithPage" resultType="map">
select * from dict_funding where 1=1
<if test="page_query != null and page_query != ''">
and (funding_name like concat('%',#{page_query},'%') or funding_eng like concat('%',#{page_query},'%') )
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
</mapper>

View File

@ -1,57 +1,57 @@
<?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.cas.idsse.dsds.mapper.dict.IDictGeomMapper">
<!-- 分页查询 -->
<update id="createVoyage">
delete from dict_geom where geom_sn=#{voyage_name};
INSERT INTO dict_geom ( geom_type, geom_sn, geom_value, create_time )
SELECT
'voyage',
voyage_name,
concat ( 'ST_GeomFromText(''LINESTRING(',string_agg ( concat ( nav_lon, '', nav_lat ), ',' ), ')''' ),
now( )
FROM
voyage_navigation v,
voyage_reg r
WHERE
v.voyage_id = r.tsy_id
where
r.voyage_name=#{voyage_name}
GROUP BY
v.voyage_id,
voyage_name
ORDER BY
v.voyage_id;
</update>
<!-- 分页查询 -->
<update id="createDiving">
delete from dict_geom where geom_sn=#{diving_sn};
INSERT INTO dict_geom ( geom_type, geom_sn, geom_value, create_time )
SELECT
'diving',
diving_sn,
concat ( 'ST_GeomFromText(''LINESTRING(', string_agg( concat ( track_lon, '', track_lat ), ',' ), ')''' ),
now( )
FROM
sample_dataset_track v,
sample_dataset r
WHERE
v.dataset_id = r.tsy_id
where r.diving_sn=#{diving_sn}
GROUP BY
r.diving_sn
ORDER BY
r.diving_sn;
</update>
<?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.cas.idsse.dsds.mapper.dict.IDictGeomMapper">
<!-- 分页查询 -->
<update id="createVoyage">
delete from dict_geom where geom_sn=#{voyage_name};
INSERT INTO dict_geom ( geom_type, geom_sn, geom_value, create_time )
SELECT
'voyage',
voyage_name,
concat ( 'ST_GeomFromText(''LINESTRING(',string_agg ( concat ( nav_lon, '', nav_lat ), ',' ), ')''' ),
now( )
FROM
voyage_navigation v,
voyage_reg r
WHERE
v.voyage_id = r.tsy_id
where
r.voyage_name=#{voyage_name}
GROUP BY
v.voyage_id,
voyage_name
ORDER BY
v.voyage_id;
</update>
<!-- 分页查询 -->
<update id="createDiving">
delete from dict_geom where geom_sn=#{diving_sn};
INSERT INTO dict_geom ( geom_type, geom_sn, geom_value, create_time )
SELECT
'diving',
diving_sn,
concat ( 'ST_GeomFromText(''LINESTRING(', string_agg( concat ( track_lon, '', track_lat ), ',' ), ')''' ),
now( )
FROM
sample_dataset_track v,
sample_dataset r
WHERE
v.dataset_id = r.tsy_id
where r.diving_sn=#{diving_sn}
GROUP BY
r.diving_sn
ORDER BY
r.diving_sn;
</update>
</mapper>

View File

@ -1,59 +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.cas.idsse.dsds.mapper.dict.IDictPlatformMapper">
<!-- 分页查询 -->
<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},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>
<?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.cas.idsse.dsds.mapper.dict.IDictPlatformMapper">
<!-- 分页查询 -->
<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},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>

View File

@ -1,23 +1,23 @@
<?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.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper">
<!-- 分页查询 -->
<select id="sailWithPage" resultType="map">
select * from dict_unit_sail where 1=1
<if test="page_query != null and page_query != ''">
and (unit_name like concat('%',#{page_query},'%') or link_man like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<?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.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper">
<!-- 分页查询 -->
<select id="sailWithPage" resultType="map">
select * from dict_unit_sail where 1=1
<if test="page_query != null and page_query != ''">
and (unit_name like concat('%',#{page_query},'%') or link_man like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
</mapper>

View File

@ -1,23 +1,23 @@
<?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.cas.idsse.dsds.mapper.dict.IDictUnitShareMapper">
<!-- 分页查询 -->
<select id="shareWithPage" resultType="map">
select * from dict_unit_share where 1=1
<if test="page_query != null and page_query != ''">
and (unit_name like concat('%',#{page_query},'%') or link_man like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<?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.cas.idsse.dsds.mapper.dict.IDictUnitShareMapper">
<!-- 分页查询 -->
<select id="shareWithPage" resultType="map">
select * from dict_unit_share where 1=1
<if test="page_query != null and page_query != ''">
and (unit_name like concat('%',#{page_query},'%') or link_man like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
</mapper>

View File

@ -1,28 +1,28 @@
<?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.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper">
<!-- 分页查询 -->
<select id="datasetWithPage" resultType="map">
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 where 1=1
<if test="page_query != null and page_query != ''">
and (dataset_name like concat('%',#{page_query},'%') or voyage_name like concat('%',#{page_query},'%')
or platform_type like concat('%',#{page_query},'%') or equipment_type like concat('%',#{query},'%')
or platform_name like concat('%',#{page_query},'%') or dataset_remark like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<?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.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper">
<!-- 分页查询 -->
<select id="datasetWithPage" resultType="map">
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 where 1=1
<if test="page_query != null and page_query != ''">
and (dataset_name like concat('%',#{page_query},'%') or voyage_name like concat('%',#{page_query},'%')
or platform_type like concat('%',#{page_query},'%') or equipment_type like concat('%',#{query},'%')
or platform_name like concat('%',#{page_query},'%') or dataset_remark like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
</mapper>

View File

@ -1,42 +1,42 @@
<?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.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper">
<select id="totalTrack" resultType="map">
select max(track_time) max_time,min(track_time) min_time,max(track_lon)
max_lon,min(track_lon) min_lin,max(track_lat) max_lat,min(track_lat)
min_lat from sample_dataset_track where dataset_id=#{dataset_id};
</select>
<select id="listTrack" resultType="map">
SELECT
t1.*
FROM
sample_dataset_track t1,(
SELECT
min( tsy_id ) tsy_id
FROM
(
SELECT
track_time,
DATE_FORMAT( track_time, '%Y-%m-%d %H:%i' ) track_minute,
tsy_id
FROM
sample_dataset_track k
WHERE
dataset_id = #{dataset_id}
AND MOD ( MINUTE ( track_time ), ${ticket_minutes} )= 0
) s
GROUP BY
track_minute
) t2
WHERE
t1.tsy_id = t2.tsy_id
AND t1.dataset_id = #{dataset_id}
ORDER BY
t1.track_time
</select>
<?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.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper">
<select id="totalTrack" resultType="map">
select max(track_time) max_time,min(track_time) min_time,max(track_lon)
max_lon,min(track_lon) min_lin,max(track_lat) max_lat,min(track_lat)
min_lat from sample_dataset_track where dataset_id=#{dataset_id};
</select>
<select id="listTrack" resultType="map">
SELECT
t1.*
FROM
sample_dataset_track t1,(
SELECT
min( tsy_id ) tsy_id
FROM
(
SELECT
track_time,
DATE_FORMAT( track_time, '%Y-%m-%d %H:%i' ) track_minute,
tsy_id
FROM
sample_dataset_track k
WHERE
dataset_id = #{dataset_id}
AND MOD ( MINUTE ( track_time ), ${ticket_minutes} )= 0
) s
GROUP BY
track_minute
) t2
WHERE
t1.tsy_id = t2.tsy_id
AND t1.dataset_id = #{dataset_id}
ORDER BY
t1.track_time
</select>
</mapper>

View File

@ -1,13 +1,13 @@
<?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.cas.idsse.dsds.mapper.sample.ISampleLineTrackMapper">
<select id="totalTrack" resultType="map">
select max(track_time) max_time,min(track_time) min_time,max(track_lon) max_lon,min(track_lon) min_lin,max(track_lat) max_lat,
min(track_lat) min_lat from sample_line_track where line_id=#{line_id};
</select>
<?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.cas.idsse.dsds.mapper.sample.ISampleLineTrackMapper">
<select id="totalTrack" resultType="map">
select max(track_time) max_time,min(track_time) min_time,max(track_lon) max_lon,min(track_lon) min_lin,max(track_lat) max_lat,
min(track_lat) min_lat from sample_line_track where line_id=#{line_id};
</select>
</mapper>

View File

@ -1,21 +1,21 @@
<?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.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper">
<!-- 分页查询 -->
<select id="memberWithPage" resultType="map">
select * from voyage_member where 1=1
<if test="voyage_id != null">
and voyage_id = #{voyage_id}
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<?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.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper">
<!-- 分页查询 -->
<select id="memberWithPage" resultType="map">
select * from voyage_member where 1=1
<if test="voyage_id != null">
and voyage_id = #{voyage_id}
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
</mapper>

View File

@ -1,26 +1,26 @@
<?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.cas.idsse.dsds.mapper.voyage.IVoyageNavigationMapper">
<!-- 分页查询 -->
<select id="navigationWithPage" resultType="map">
select * from voyage_navigation where 1=1
<if test="voyage_id != null">
and voyage_id = #{voyage_id}
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<select id="totalNavigation" resultType="map">
select max(nav_time) max_time,min(nav_time) min_time,max(nav_lon) max_lon,min(nav_lon) min_lin,max(nav_lat) max_lat,min(nav_lat) min_lat from voyage_navigation where voyage_id=#{voyage_id};
</select>
<select id="listNavigation" resultType="map">
select * from voyage_navigation where VOYAGE_ID=#{voyage_id} and MOD(MINUTE(NAV_TIME),${ticket_minutes})=0 order by nav_time
</select>
<?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.cas.idsse.dsds.mapper.voyage.IVoyageNavigationMapper">
<!-- 分页查询 -->
<select id="navigationWithPage" resultType="map">
select * from voyage_navigation where 1=1
<if test="voyage_id != null">
and voyage_id = #{voyage_id}
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<select id="totalNavigation" resultType="map">
select max(nav_time) max_time,min(nav_time) min_time,max(nav_lon) max_lon,min(nav_lon) min_lin,max(nav_lat) max_lat,min(nav_lat) min_lat from voyage_navigation where voyage_id=#{voyage_id};
</select>
<select id="listNavigation" resultType="map">
select * from voyage_navigation where VOYAGE_ID=#{voyage_id} and MOD(MINUTE(NAV_TIME),${ticket_minutes})=0 order by nav_time
</select>
</mapper>

View File

@ -1,81 +1,81 @@
<?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.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper">
<!-- 分页查询 -->
<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 and (serect_status='InActive'
<if test="role_id != null and (role_id ==2 or role_id==1)">
or serect_status='Active'
</if>
<if test="role_id != null and role_id==3">
or r.tsy_id in (select voyage_id from voyage_reg_optr where optr_id=#{optr_id})
</if>
)
<if test="page_query != null and page_query != ''">
and (voyage_name like concat('%',#{page_query},'%') or voyage_officer like concat('%',#{page_query},'%')
or voyage_officer like concat('%',#{page_query},'%') or voyage_remark like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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
and (serect_status='InActive'
<if test="role_id != null and (role_id ==2 or role_id==1)">
or serect_status='Active'
</if>
<if test="role_id != null and role_id==3">
or r.tsy_id in (select voyage_id from voyage_reg_optr where optr_id=#{optr_id})
</if>
)
<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(voyage_days) day_total,sum(coalesce(voyage_mileage,0)) mileage_total from voyage_reg where 1=1
<if test="start_date != null ">
and voyage_start_date &gt;= #{start_date}
</if>
<if test="end_date != null ">
and voyage_end_date &lt;= #{end_date}
</if>
</select>
<?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.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper">
<!-- 分页查询 -->
<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 and (serect_status='InActive'
<if test="role_id != null and (role_id ==2 or role_id==1)">
or serect_status='Active'
</if>
<if test="role_id != null and role_id==3">
or r.tsy_id in (select voyage_id from voyage_reg_optr where optr_id=#{optr_id})
</if>
)
<if test="page_query != null and page_query != ''">
and (voyage_name like concat('%',#{page_query},'%') or voyage_officer like concat('%',#{page_query},'%')
or voyage_officer like concat('%',#{page_query},'%') or voyage_remark like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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
and (serect_status='InActive'
<if test="role_id != null and (role_id ==2 or role_id==1)">
or serect_status='Active'
</if>
<if test="role_id != null and role_id==3">
or r.tsy_id in (select voyage_id from voyage_reg_optr where optr_id=#{optr_id})
</if>
)
<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(voyage_days) day_total,sum(coalesce(voyage_mileage,0)) mileage_total from voyage_reg where 1=1
<if test="start_date != null ">
and voyage_start_date &gt;= #{start_date}
</if>
<if test="end_date != null ">
and voyage_end_date &lt;= #{end_date}
</if>
</select>
</mapper>

View File

@ -1,12 +1,12 @@
<?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.cas.idsse.dsds.mapper.voyage.IVoyageRegOptrMapper">
<!-- 分页查询 -->
<select id="listVoyage" resultType="cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg">
select v.* from voyage_reg v,voyage_reg_optr o where v.tsy_id=o.voyage_id and o.optr_id=#{optr_id}
</select>
<?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.cas.idsse.dsds.mapper.voyage.IVoyageRegOptrMapper">
<!-- 分页查询 -->
<select id="listVoyage" resultType="cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg">
select v.* from voyage_reg v,voyage_reg_optr o where v.tsy_id=o.voyage_id and o.optr_id=#{optr_id}
</select>
</mapper>

View File

@ -1,257 +1,257 @@
<?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.cas.idsse.dsds.mapper.voyage.IVoyageRegReportMapper">
<select id="reportShipTotal" resultType="map">
SELECT
<if test="year != null">
date_part('year', voyage_start_date) as year,
</if>
sum(voyage_days) days_total,
sum(COALESCE(a.voyage_mileage,0))
mileage_total,
sum(dataset_total) dataset_total,
sum(unit_total)
unit_total,
sum(member_total) member_total
FROM
voyage_reg A,
( SELECT
voyage_id, COUNT ( 1 ) dataset_total FROM sample_dataset GROUP
BY
voyage_id ) b,
( SELECT voyage_id, COUNT ( 1 ) member_total, COUNT (
DISTINCT
member_unit ) unit_total FROM voyage_member WHERE member_unit
!=
'海南深科海洋技术服务有限公司' GROUP BY voyage_id ) C
WHERE
A.tsy_id = b.voyage_id
AND A.tsy_id = C.voyage_id
<if test="ship_name != null and ship_name != ''">
and ship_name=#{ship_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
group by date_part('year', voyage_start_date)
</if>
</select>
<select id="reportShipUnit" resultType="map">
SELECT
DISTINCT
s.*
FROM
dict_unit_sail s,
voyage_reg r,
voyage_member M
WHERE
member_unit!='海南深科海洋技术服务有限公司' and
s.unit_name = M.member_unit
AND
r.tsy_id = M.voyage_id
<if test="ship_name != null and ship_name != ''">
and ship_name=#{ship_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
and date_part('year', voyage_start_date)=#{year}
</if>
</select>
<select id="reportShipUnitWithYear" resultType="map">
SELECT
<if test="ship_name != null and ship_name != ''">
ship_name,
</if>
concat(voyage_year,'') voyage_year,
COUNT ( 1 ) unit_total,
SUM ( CASE WHEN voyage_year = unit_year THEN 1 ELSE 0 END )
year_unit_total
FROM
(
SELECT
ship_name,
unit_name,
voyage_year,
unit_year
FROM
(
SELECT
ship_name,
date_part( 'year', voyage_start_date ) voyage_year,
unit_name,
date_part( 'year', u.create_time ) unit_year
FROM
voyage_reg vr,
voyage_member vm,
dict_unit_sail u
WHERE
vr.tsy_id = vm.voyage_id
AND u.unit_name = vm.member_unit
AND member_unit != '海南深科海洋技术服务有限公司'
)
GROUP BY
ship_name,
unit_name,
voyage_year,
unit_year
)
<if test="ship_name != null and ship_name != ''">
where ship_name=#{ship_name}
</if>
GROUP BY
<if test="ship_name != null and ship_name != ''">
ship_name,
</if>
voyage_year
</select>
<select id="reportPlatformTotal" resultType="map">
SELECT
<if test="year != null">
date_part('year', 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
FROM
sample_dataset ds,
voyage_reg r
WHERE
ds.voyage_id = r.tsy_id
and platform_type in
(${platform_type})
<if test="platform_name != null and platform_name!=''">
and platform_name = #{platform_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
group by date_part('year', voyage_start_date)
</if>
</select>
<select id="reportPlatformUnit" resultType="map">
SELECT DISTINCT
s.*
FROM
dict_unit_sail s,
voyage_reg r,
sample_dataset sd
WHERE
unit_name != '海南深科海洋技术服务有限公司'
AND (s.unit_name = sd.driver_unit_left or s.unit_name=sd.driver_unit_right)
AND sd.voyage_id = r.tsy_id
and
platform_type in (${platform_type})
<if test="platform_name != null and platform_name!=''">
and platform_name = #{platform_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
and date_part('year', voyage_start_date)=#{year}
</if>
</select>
<select id="reportPlatformDiving" resultType="map">
SELECT
DISTINCT
diving_sn
FROM
voyage_reg r,
sample_dataset sd
WHERE
r.tsy_id = sd.voyage_id and diving_sn is not null
and
platform_type in (${platform_type})
<if test="platform_name != null and platform_name!=''">
and platform_name = #{platform_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
and date_part('year', voyage_start_date)=#{year}
</if>
</select>
<select id="reportPlatfromUnitWithYear" resultType="map">
SELECT
<if test="platform_name != null and platform_name!=''">
platform_name,
</if>
concat ( voyage_year, '' ) voyage_year,
COUNT ( 1 ) unit_total,
SUM ( CASE WHEN voyage_year = unit_year THEN 1 ELSE 0 END ) year_unit_total
FROM
(
SELECT
platform_type,
platform_name,
unit_name,
voyage_year,
unit_year
FROM
(
SELECT
platform_type,
platform_name,
date_part( 'year', voyage_start_date ) voyage_year,
unit_name,
date_part( 'year', u.create_time ) unit_year
FROM
voyage_reg vr,
sample_dataset ds,
dict_unit_sail u
WHERE
ds.voyage_id = vr.tsy_id
AND ( u.unit_name = ds.driver_unit_left OR u.unit_name = driver_unit_right )
AND platform_type IN ( ${platform_type})
)
GROUP BY
platform_type,
platform_name,
unit_name,
voyage_year,
unit_year
)
<if test="platform_name != null and platform_name != ''">
where platform_name=#{platform_name}
</if>
GROUP BY
<if test="platform_name != null and platform_name != ''">
platform_name,
</if>
voyage_year
</select>
<?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.cas.idsse.dsds.mapper.voyage.IVoyageRegReportMapper">
<select id="reportShipTotal" resultType="map">
SELECT
<if test="year != null">
date_part('year', voyage_start_date) as year,
</if>
sum(voyage_days) days_total,
sum(COALESCE(a.voyage_mileage,0))
mileage_total,
sum(dataset_total) dataset_total,
sum(unit_total)
unit_total,
sum(member_total) member_total
FROM
voyage_reg A,
( SELECT
voyage_id, COUNT ( 1 ) dataset_total FROM sample_dataset GROUP
BY
voyage_id ) b,
( SELECT voyage_id, COUNT ( 1 ) member_total, COUNT (
DISTINCT
member_unit ) unit_total FROM voyage_member WHERE member_unit
!=
'海南深科海洋技术服务有限公司' GROUP BY voyage_id ) C
WHERE
A.tsy_id = b.voyage_id
AND A.tsy_id = C.voyage_id
<if test="ship_name != null and ship_name != ''">
and ship_name=#{ship_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
group by date_part('year', voyage_start_date)
</if>
</select>
<select id="reportShipUnit" resultType="map">
SELECT
DISTINCT
s.*
FROM
dict_unit_sail s,
voyage_reg r,
voyage_member M
WHERE
member_unit!='海南深科海洋技术服务有限公司' and
s.unit_name = M.member_unit
AND
r.tsy_id = M.voyage_id
<if test="ship_name != null and ship_name != ''">
and ship_name=#{ship_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
and date_part('year', voyage_start_date)=#{year}
</if>
</select>
<select id="reportShipUnitWithYear" resultType="map">
SELECT
<if test="ship_name != null and ship_name != ''">
ship_name,
</if>
concat(voyage_year,'') voyage_year,
COUNT ( 1 ) unit_total,
SUM ( CASE WHEN voyage_year = unit_year THEN 1 ELSE 0 END )
year_unit_total
FROM
(
SELECT
ship_name,
unit_name,
voyage_year,
unit_year
FROM
(
SELECT
ship_name,
date_part( 'year', voyage_start_date ) voyage_year,
unit_name,
date_part( 'year', u.create_time ) unit_year
FROM
voyage_reg vr,
voyage_member vm,
dict_unit_sail u
WHERE
vr.tsy_id = vm.voyage_id
AND u.unit_name = vm.member_unit
AND member_unit != '海南深科海洋技术服务有限公司'
)
GROUP BY
ship_name,
unit_name,
voyage_year,
unit_year
)
<if test="ship_name != null and ship_name != ''">
where ship_name=#{ship_name}
</if>
GROUP BY
<if test="ship_name != null and ship_name != ''">
ship_name,
</if>
voyage_year
</select>
<select id="reportPlatformTotal" resultType="map">
SELECT
<if test="year != null">
date_part('year', 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
FROM
sample_dataset ds,
voyage_reg r
WHERE
ds.voyage_id = r.tsy_id
and platform_type in
(${platform_type})
<if test="platform_name != null and platform_name!=''">
and platform_name = #{platform_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
group by date_part('year', voyage_start_date)
</if>
</select>
<select id="reportPlatformUnit" resultType="map">
SELECT DISTINCT
s.*
FROM
dict_unit_sail s,
voyage_reg r,
sample_dataset sd
WHERE
unit_name != '海南深科海洋技术服务有限公司'
AND (s.unit_name = sd.driver_unit_left or s.unit_name=sd.driver_unit_right)
AND sd.voyage_id = r.tsy_id
and
platform_type in (${platform_type})
<if test="platform_name != null and platform_name!=''">
and platform_name = #{platform_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
and date_part('year', voyage_start_date)=#{year}
</if>
</select>
<select id="reportPlatformDiving" resultType="map">
SELECT
DISTINCT
diving_sn
FROM
voyage_reg r,
sample_dataset sd
WHERE
r.tsy_id = sd.voyage_id and diving_sn is not null
and
platform_type in (${platform_type})
<if test="platform_name != null and platform_name!=''">
and platform_name = #{platform_name}
</if>
<if test="start != null">
and voyage_start_date &gt;= #{start}
</if>
<if test="end != null">
and voyage_start_date &lt;= #{end}
</if>
<if test="year != null and year != ''">
and date_part('year', voyage_start_date)=#{year}
</if>
</select>
<select id="reportPlatfromUnitWithYear" resultType="map">
SELECT
<if test="platform_name != null and platform_name!=''">
platform_name,
</if>
concat ( voyage_year, '' ) voyage_year,
COUNT ( 1 ) unit_total,
SUM ( CASE WHEN voyage_year = unit_year THEN 1 ELSE 0 END ) year_unit_total
FROM
(
SELECT
platform_type,
platform_name,
unit_name,
voyage_year,
unit_year
FROM
(
SELECT
platform_type,
platform_name,
date_part( 'year', voyage_start_date ) voyage_year,
unit_name,
date_part( 'year', u.create_time ) unit_year
FROM
voyage_reg vr,
sample_dataset ds,
dict_unit_sail u
WHERE
ds.voyage_id = vr.tsy_id
AND ( u.unit_name = ds.driver_unit_left OR u.unit_name = driver_unit_right )
AND platform_type IN ( ${platform_type})
)
GROUP BY
platform_type,
platform_name,
unit_name,
voyage_year,
unit_year
)
<if test="platform_name != null and platform_name != ''">
where platform_name=#{platform_name}
</if>
GROUP BY
<if test="platform_name != null and platform_name != ''">
platform_name,
</if>
voyage_year
</select>
</mapper>

View File

@ -1,18 +1,18 @@
#JdbcUrl=jdbc:mysql://116.211.2.76:65206/aigg2025?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&verifyServerCertificate=false&autoReconnct=true&autoReconnectForPools=true&allowMultiQueries=true&allowPublicKeyRetrieval=true
#JdbcUser=root
#JdbcPassword=hm2022
JdbcUrl=jdbc:postgresql://1.95.42.191:5432/idsse_dsds
JdbcUser=postgres
JdbcPassword=a654321a
#JdbcUrl=jdbc:mysql://1.95.42.191:3306/xacom_tk?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&verifyServerCertificate=false&autoReconnct=true&autoReconnectForPools=true&allowMultiQueries=true&allowPublicKeyRetrieval=true
#JdbcUser=root
#JdbcPassword=a654321a
JdbcCheckouttimeout=30000
JdbcMaxpoolsize=200
#test.JdbcDriverClass=org.sqlite.JDBC
#test.JdbcUrl=jdbc:sqlite://d:\\gopmas.db
#test.JdbcCheckouttimeout=30000
#JdbcUrl=jdbc:mysql://116.211.2.76:65206/aigg2025?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&verifyServerCertificate=false&autoReconnct=true&autoReconnectForPools=true&allowMultiQueries=true&allowPublicKeyRetrieval=true
#JdbcUser=root
#JdbcPassword=hm2022
JdbcUrl=jdbc:postgresql://1.95.42.191:5432/idsse_dsds
JdbcUser=postgres
JdbcPassword=a654321a
#JdbcUrl=jdbc:mysql://1.95.42.191:3306/xacom_tk?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&verifyServerCertificate=false&autoReconnct=true&autoReconnectForPools=true&allowMultiQueries=true&allowPublicKeyRetrieval=true
#JdbcUser=root
#JdbcPassword=a654321a
JdbcCheckouttimeout=30000
JdbcMaxpoolsize=200
#test.JdbcDriverClass=org.sqlite.JDBC
#test.JdbcUrl=jdbc:sqlite://d:\\gopmas.db
#test.JdbcCheckouttimeout=30000
#test.JdbcMaxpoolsize=200

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,31 @@
1.数据库更新至20251026包含之前所输入信息以此数据为基础版本
增加表
dict_geom
geom_type字段voyage表示航次diving表示潜次
geom_sn表示航次号或者潜次号
geom_valuegeoserver能直接用的sql语句
geom_name:预留给geoserver回写
geom_level:预留给geoserver回写
2025-10-31更新
更新自动增长序列
SELECT setval('dict_data_tsy_id_seq',(SELECT max(tsy_id) FROM dict_data));
SELECT setval('dict_equipment_tsy_id_seq',(SELECT max(tsy_id) FROM dict_equipment));
SELECT setval('dict_funding_tsy_id_seq',(SELECT max(tsy_id) FROM dict_funding));
SELECT setval('dict_geom_tsy_id_seq',(SELECT max(tsy_id) FROM dict_geom));
SELECT setval('dict_platform_copy1_tsy_id_seq',(SELECT max(tsy_id) FROM dict_report));
SELECT setval('dict_platform_tsy_id_seq',(SELECT max(tsy_id) FROM dict_platform));
SELECT setval('dict_unit_sail_tsy_id_seq',(SELECT max(tsy_id) FROM dict_unit_sail));
SELECT setval('dict_unit_share_tsy_id_seq',(SELECT max(tsy_id) FROM dict_unit_share));
SELECT setval('hme_frame_dept_dept_id_seq',(SELECT max(dept_id) FROM hme_frame_dept));
SELECT setval('hme_frame_optr_optr_id_seq',(SELECT max(optr_id) FROM hme_frame_optr));
SELECT setval('hme_frame_role_role_id_seq',(SELECT max(role_id) FROM hme_frame_role));
SELECT setval('sample_dataset_tsy_id_seq',(SELECT max(tsy_id) FROM sample_dataset));
SELECT setval('sample_line_track_tsy_id_seq',(SELECT max(tsy_id) FROM sample_line_track));
SELECT setval('sample_line_tsy_id_seq',(SELECT max(tsy_id) FROM sample_line));
SELECT setval('sample_station_track_tsy_id_seq',(SELECT max(tsy_id) FROM sample_station_track));
SELECT setval('sample_station_tsy_id_seq',(SELECT max(tsy_id) FROM sample_station));
SELECT setval('voyage_log_tsy_id_seq',(SELECT max(tsy_id) FROM voyage_log));
SELECT setval('voyage_member_tsy_id_seq',(SELECT max(tsy_id) FROM voyage_member));
SELECT setval('voyage_navigation_tsy_id_seq',(SELECT max(tsy_id) FROM voyage_navigation));
1.数据库更新至20251026包含之前所输入信息以此数据为基础版本
增加表
dict_geom
geom_type字段voyage表示航次diving表示潜次
geom_sn表示航次号或者潜次号
geom_valuegeoserver能直接用的sql语句
geom_name:预留给geoserver回写
geom_level:预留给geoserver回写
2025-10-31更新
更新自动增长序列
SELECT setval('dict_data_tsy_id_seq',(SELECT max(tsy_id) FROM dict_data));
SELECT setval('dict_equipment_tsy_id_seq',(SELECT max(tsy_id) FROM dict_equipment));
SELECT setval('dict_funding_tsy_id_seq',(SELECT max(tsy_id) FROM dict_funding));
SELECT setval('dict_geom_tsy_id_seq',(SELECT max(tsy_id) FROM dict_geom));
SELECT setval('dict_platform_copy1_tsy_id_seq',(SELECT max(tsy_id) FROM dict_report));
SELECT setval('dict_platform_tsy_id_seq',(SELECT max(tsy_id) FROM dict_platform));
SELECT setval('dict_unit_sail_tsy_id_seq',(SELECT max(tsy_id) FROM dict_unit_sail));
SELECT setval('dict_unit_share_tsy_id_seq',(SELECT max(tsy_id) FROM dict_unit_share));
SELECT setval('hme_frame_dept_dept_id_seq',(SELECT max(dept_id) FROM hme_frame_dept));
SELECT setval('hme_frame_optr_optr_id_seq',(SELECT max(optr_id) FROM hme_frame_optr));
SELECT setval('hme_frame_role_role_id_seq',(SELECT max(role_id) FROM hme_frame_role));
SELECT setval('sample_dataset_tsy_id_seq',(SELECT max(tsy_id) FROM sample_dataset));
SELECT setval('sample_line_track_tsy_id_seq',(SELECT max(tsy_id) FROM sample_line_track));
SELECT setval('sample_line_tsy_id_seq',(SELECT max(tsy_id) FROM sample_line));
SELECT setval('sample_station_track_tsy_id_seq',(SELECT max(tsy_id) FROM sample_station_track));
SELECT setval('sample_station_tsy_id_seq',(SELECT max(tsy_id) FROM sample_station));
SELECT setval('voyage_log_tsy_id_seq',(SELECT max(tsy_id) FROM voyage_log));
SELECT setval('voyage_member_tsy_id_seq',(SELECT max(tsy_id) FROM voyage_member));
SELECT setval('voyage_navigation_tsy_id_seq',(SELECT max(tsy_id) FROM voyage_navigation));
SELECT setval('voyage_reg_tsy_id_seq',(SELECT max(tsy_id) FROM voyage_reg));

View File

@ -1,5 +1,5 @@
AppDebug=true
AppTrace=true
AppParamHelper=cn.tsy.cas.idsse.dsds.helper.DsdsParamHelper
AppListener=cn.tsy.cas.idsse.dsds.control.DSDSInitializeListener
AppDebug=true
AppTrace=true
AppParamHelper=cn.tsy.cas.idsse.dsds.helper.DSDSParamHelper
AppListener=cn.tsy.cas.idsse.dsds.control.DSDSInitializeListener
AppName=DSDSServer

View File

@ -1,23 +1,23 @@
package cn.tsy.cas.idsse.dsds.constant;
/***********************
* 航次作业类型
* @author TsySoft
* @create 2024-05-14 10:08:05
* @version 1.0.0
* @email revisit@126.com
*
*/
public class VoyageJobType {
/*******************
* 测线作业
*/
public static final String Line = "测线作业";
/*******************
* 站位作业
*/
public static final String Station = "站位作业";
}
package cn.tsy.cas.idsse.dsds.constant;
/***********************
* 航次作业类型
* @author TsySoft
* @create 2024-05-14 10:08:05
* @version 1.0.0
* @email revisit@126.com
*
*/
public class VoyageJobType {
/*******************
* 测线作业
*/
public static final String Line = "测线作业";
/*******************
* 站位作业
*/
public static final String Station = "站位作业";
}

View File

@ -1,27 +1,27 @@
package cn.tsy.cas.idsse.dsds.constant;
/***********************
* 航次日志类型
* @author TsySoft
* @create 2024-05-14 10:08:05
* @version 1.0.0
* @email revisit@126.com
*
*/
public class VoyageLogType {
/*******************
* 建立航次
*/
public static final String Create = "Create";
/*******************
* 导入导航文件
*/
public static final String UploadNavigation = "UploadNavigation";
/*******************
* 导入参航人员
*/
public static final String UploadMember = "UploadMebmer";
}
package cn.tsy.cas.idsse.dsds.constant;
/***********************
* 航次日志类型
* @author TsySoft
* @create 2024-05-14 10:08:05
* @version 1.0.0
* @email revisit@126.com
*
*/
public class VoyageLogType {
/*******************
* 建立航次
*/
public static final String Create = "Create";
/*******************
* 导入导航文件
*/
public static final String UploadNavigation = "UploadNavigation";
/*******************
* 导入参航人员
*/
public static final String UploadMember = "UploadMebmer";
}

View File

@ -1,17 +1,17 @@
package cn.tsy.cas.idsse.dsds.constant;
/***********************
* 航次日志类型
* @author TsySoft
* @create 2024-05-14 10:08:05
* @version 1.0.0
* @email revisit@126.com
*
*/
public class VoyageStatus {
/*******************
* 计划
*/
public static final String Plan = "Plan";
}
package cn.tsy.cas.idsse.dsds.constant;
/***********************
* 航次日志类型
* @author TsySoft
* @create 2024-05-14 10:08:05
* @version 1.0.0
* @email revisit@126.com
*
*/
public class VoyageStatus {
/*******************
* 计划
*/
public static final String Plan = "Plan";
}

View File

@ -1,7 +1,7 @@
package cn.tsy.cas.idsse.dsds.control;
import cn.hme.framework.frame.control.HmeFrameControl;
public class DSDSControl extends HmeFrameControl{
}
package cn.tsy.cas.idsse.dsds.control;
import cn.hme.framework.frame.control.HmeFrameControl;
public class DSDSControl extends HmeFrameControl{
}

View File

@ -1,21 +1,21 @@
package cn.tsy.cas.idsse.dsds.control;
import cn.hme.framework.core.HmeAppParamerter;
import cn.tsy.cas.idsse.dsds.thread.DSDSReportThread;
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
public class DSDSInitializeListener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sc) {
if (HmeAppParamerter.AppName.equals("DSDSServer")) {
new Thread(new DSDSReportThread()).start();
}
}
@Override
public void contextDestroyed(ServletContextEvent sc) {
}
}
package cn.tsy.cas.idsse.dsds.control;
import cn.hme.framework.core.HmeAppParamerter;
import cn.tsy.cas.idsse.dsds.thread.DSDSReportThread;
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
public class DSDSInitializeListener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sc) {
if (HmeAppParamerter.AppName.equals("DSDSServer")) {
new Thread(new DSDSReportThread()).start();
}
}
@Override
public void contextDestroyed(ServletContextEvent sc) {
}
}

View File

@ -1,42 +1,42 @@
package cn.tsy.cas.idsse.dsds.control.api;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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 cn.hme.framework.frame.control.HmeAjax;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
@RestController
@CrossOrigin
@RequestMapping("api/voyage")
public class DSDSApiVoyageControl {
@Autowired
private IVoyageRegMapper iVoayge;
@RequestMapping("list.htm")
public HmeAjax list() {
String sql = "select sd.voyage_id,r.voyage_name,r.ship_name,line.dataset_id,line.dataset_name,line.conver_area,line.tsy_id sample_id,line.sample_name,r.voyage_mileage,diving_sn,voyage_days "
+ "from voyage_reg r,sample_dataset sd,sample_line line where r.tsy_id=sd.voyage_id and sd.tsy_id=line.dataset_id and sample_tag_name='应急搜捞' order by line.dataset_name";
List<Map<String,Object>> array = this.iVoayge.mapBySql(sql);
Map<String,List<Map<String,Object>>> mapReturn = new HashMap<>();
List<Map<String,Object>> arrayReturn = new ArrayList<>();
for(Map<String,Object> map:array) {
String voyage_name = map.get("voyage_name").toString();
if(!mapReturn.containsKey(voyage_name)) {
arrayReturn.add(map);
mapReturn.put(voyage_name, new ArrayList<>());
}
mapReturn.get(voyage_name).add(map);
}
mapReturn.put("VoyageArray", arrayReturn);
return new HmeAjax(mapReturn);
}
}
package cn.tsy.cas.idsse.dsds.control.api;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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 cn.hme.framework.frame.control.HmeAjax;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
@RestController
@CrossOrigin
@RequestMapping("api/voyage")
public class DSDSApiVoyageControl {
@Autowired
private IVoyageRegMapper iVoayge;
@RequestMapping("list.htm")
public HmeAjax list() {
String sql = "select sd.voyage_id,r.voyage_name,r.ship_name,line.dataset_id,line.dataset_name,line.conver_area,line.tsy_id sample_id,line.sample_name,r.voyage_mileage,diving_sn,voyage_days "
+ "from voyage_reg r,sample_dataset sd,sample_line line where r.tsy_id=sd.voyage_id and sd.tsy_id=line.dataset_id and sample_tag_name='应急搜捞' order by line.dataset_name";
List<Map<String,Object>> array = this.iVoayge.mapBySql(sql);
Map<String,List<Map<String,Object>>> mapReturn = new HashMap<>();
List<Map<String,Object>> arrayReturn = new ArrayList<>();
for(Map<String,Object> map:array) {
String voyage_name = map.get("voyage_name").toString();
if(!mapReturn.containsKey(voyage_name)) {
arrayReturn.add(map);
mapReturn.put(voyage_name, new ArrayList<>());
}
mapReturn.get(voyage_name).add(map);
}
mapReturn.put("VoyageArray", arrayReturn);
return new HmeAjax(mapReturn);
}
}

View File

@ -1,55 +1,55 @@
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.OrderBy;
import cn.hme.framework.jdbc.entity.OrderByType;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictDataService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictDataMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictData;
@RestController
@RequestMapping("dict/data")
public class DictDataControl extends HmeAjaxControl {
@Autowired
private IDictDataMapper mData;
@Autowired
private DictDataService sData;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "data_order";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mData.dataWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("all.htm")
public HmeAjax all() {
return new HmeAjax(this.mData.allByOrder(OrderBy.of("data_order", OrderByType.DESC)));
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictData data) {
DSDSWebHelper.getFrameOptr(true);
this.sData.editData(data);
return new HmeAjax(data);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sData.deleteData(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.OrderBy;
import cn.hme.framework.jdbc.entity.OrderByType;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictDataService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictDataMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictData;
@RestController
@RequestMapping("dict/data")
public class DictDataControl extends HmeAjaxControl {
@Autowired
private IDictDataMapper mData;
@Autowired
private DictDataService sData;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "data_order";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mData.dataWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("all.htm")
public HmeAjax all() {
return new HmeAjax(this.mData.allByOrder(OrderBy.of("data_order", OrderByType.DESC)));
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictData data) {
DSDSWebHelper.getFrameOptr(true);
this.sData.editData(data);
return new HmeAjax(data);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sData.deleteData(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,57 +1,57 @@
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.OrderBy;
import cn.hme.framework.jdbc.entity.OrderByType;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictEquipmentService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictEquipment;
@RestController
@RequestMapping("dict/equipment")
public class DictEquipmentControl extends HmeAjaxControl{
@Autowired
private IDictEquipmentMapper mEquipment;
@Autowired
private DictEquipmentService sEquipment;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "equipment_order";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mEquipment.equipmentWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("all.htm")
public HmeAjax all() {
return new HmeAjax(this.mEquipment.allByOrder(OrderBy.of("equipment_order",OrderByType.DESC)));
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictEquipment equipment) {
DSDSWebHelper.getFrameOptr(true);
this.sEquipment.editEquipment(equipment);
return new HmeAjax(equipment);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sEquipment.deleteEquipment(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.OrderBy;
import cn.hme.framework.jdbc.entity.OrderByType;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictEquipmentService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictEquipment;
@RestController
@RequestMapping("dict/equipment")
public class DictEquipmentControl extends HmeAjaxControl{
@Autowired
private IDictEquipmentMapper mEquipment;
@Autowired
private DictEquipmentService sEquipment;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "equipment_order";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mEquipment.equipmentWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("all.htm")
public HmeAjax all() {
return new HmeAjax(this.mEquipment.allByOrder(OrderBy.of("equipment_order",OrderByType.DESC)));
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictEquipment equipment) {
DSDSWebHelper.getFrameOptr(true);
this.sEquipment.editEquipment(equipment);
return new HmeAjax(equipment);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sEquipment.deleteEquipment(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,57 +1,57 @@
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.OrderBy;
import cn.hme.framework.jdbc.entity.OrderByType;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictFundingService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictFundingMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictFunding;
@RestController
@RequestMapping("dict/funding")
public class DictFundingControl extends HmeAjaxControl{
@Autowired
private IDictFundingMapper mFunding;
@Autowired
private DictFundingService sFunding;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "funding_order";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mFunding.fundingWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("all.htm")
public HmeAjax all() {
return new HmeAjax(this.mFunding.allByOrder(OrderBy.of("funding_order",OrderByType.DESC)));
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictFunding funding) {
DSDSWebHelper.getFrameOptr(true);
this.sFunding.editFunding(funding);
return new HmeAjax(funding);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sFunding.deleteFunding(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.OrderBy;
import cn.hme.framework.jdbc.entity.OrderByType;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictFundingService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictFundingMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictFunding;
@RestController
@RequestMapping("dict/funding")
public class DictFundingControl extends HmeAjaxControl{
@Autowired
private IDictFundingMapper mFunding;
@Autowired
private DictFundingService sFunding;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "funding_order";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mFunding.fundingWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("all.htm")
public HmeAjax all() {
return new HmeAjax(this.mFunding.allByOrder(OrderBy.of("funding_order",OrderByType.DESC)));
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictFunding funding) {
DSDSWebHelper.getFrameOptr(true);
this.sFunding.editFunding(funding);
return new HmeAjax(funding);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sFunding.deleteFunding(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,63 +1,63 @@
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.OrderBy;
import cn.hme.framework.jdbc.entity.OrderByType;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictPlatformService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictPlatformMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictPlatform;
@RestController
@RequestMapping("dict/platform")
public class DictPlatformControl extends HmeAjaxControl {
@Autowired
private IDictPlatformMapper mPlatform;
@Autowired
private DictPlatformService sPlatform;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "platform_order";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mPlatform.platformWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("all.htm")
public HmeAjax all() {
return new HmeAjax(this.mPlatform.allByOrder(OrderBy.of("platform_order",OrderByType.DESC)));
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictPlatform platform) {
DSDSWebHelper.getFrameOptr(true);
this.sPlatform.editPlatform(platform);
return new HmeAjax(platform);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sPlatform.deletePlatform(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.OrderBy;
import cn.hme.framework.jdbc.entity.OrderByType;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictPlatformService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictPlatformMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictPlatform;
@RestController
@RequestMapping("dict/platform")
public class DictPlatformControl extends HmeAjaxControl {
@Autowired
private IDictPlatformMapper mPlatform;
@Autowired
private DictPlatformService sPlatform;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "platform_order";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mPlatform.platformWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("all.htm")
public HmeAjax all() {
return new HmeAjax(this.mPlatform.allByOrder(OrderBy.of("platform_order",OrderByType.DESC)));
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictPlatform platform) {
DSDSWebHelper.getFrameOptr(true);
this.sPlatform.editPlatform(platform);
return new HmeAjax(platform);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sPlatform.deletePlatform(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,48 +1,48 @@
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictUnitSailService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitSail;
@RestController
@RequestMapping("dict/unit/sail")
public class DictUnitSailControl extends HmeAjaxControl{
@Autowired
private IDictUnitSailMapper mUnitSail;
@Autowired
private DictUnitSailService sUnitSail;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "unit_name";
Pageable page = this.mUnitSail.sailWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictUnitSail sail) {
DSDSWebHelper.getFrameOptr(true);
this.sUnitSail.editUnitSail(sail);
return new HmeAjax(sail);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sUnitSail.deleteUnitSail(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictUnitSailService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitSail;
@RestController
@RequestMapping("dict/unit/sail")
public class DictUnitSailControl extends HmeAjaxControl{
@Autowired
private IDictUnitSailMapper mUnitSail;
@Autowired
private DictUnitSailService sUnitSail;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "unit_name";
Pageable page = this.mUnitSail.sailWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictUnitSail sail) {
DSDSWebHelper.getFrameOptr(true);
this.sUnitSail.editUnitSail(sail);
return new HmeAjax(sail);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sUnitSail.deleteUnitSail(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,48 +1,48 @@
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictUnitShareService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitShareMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitShare;
@RestController
@RequestMapping("dict/unit/share")
public class DictUnitShareControl extends HmeAjaxControl{
@Autowired
private IDictUnitShareMapper mUnitShare;
@Autowired
private DictUnitShareService sUnitShare;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "unit_name";
Pageable page = this.mUnitShare.shareWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictUnitShare sail) {
DSDSWebHelper.getFrameOptr(true);
this.sUnitShare.editUnitShare(sail);
return new HmeAjax(sail);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sUnitShare.deleteUnitShare(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.dict.DictUnitShareService;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitShareMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitShare;
@RestController
@RequestMapping("dict/unit/share")
public class DictUnitShareControl extends HmeAjaxControl{
@Autowired
private IDictUnitShareMapper mUnitShare;
@Autowired
private DictUnitShareService sUnitShare;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "unit_name";
Pageable page = this.mUnitShare.shareWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("edit.htm")
public HmeAjax edit(DictUnitShare sail) {
DSDSWebHelper.getFrameOptr(true);
this.sUnitShare.editUnitShare(sail);
return new HmeAjax(sail);
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sUnitShare.deleteUnitShare(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,35 +1,35 @@
package cn.tsy.cas.idsse.dsds.control.login;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
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.frame.control.dict.HmeFrameDictHelper;
import cn.hme.framework.frame.control.param.HmeFrameParamHelper;
@RestController
@CrossOrigin
@RequestMapping("login")
public class DSDSLoginControl extends HmeAjaxControl {
@RequestMapping("init.htm")
public HmeAjax init() {
Map<String, Object> map = new HashMap<String, Object>();
// 字典信息
map.put("FrameDictArray", HmeFrameDictHelper.create().getArrayDict());
// 服务器时间
map.put("FrameCurrentTime", LocalDateTime.now());
// 系统所有参数
map.put("FrameParamArray", HmeFrameParamHelper.create().getParam());
return new HmeAjax(map);
}
}
package cn.tsy.cas.idsse.dsds.control.login;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
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.frame.control.dict.HmeFrameDictHelper;
import cn.hme.framework.frame.control.param.HmeFrameParamHelper;
@RestController
@CrossOrigin
@RequestMapping("login")
public class DSDSLoginControl extends HmeAjaxControl {
@RequestMapping("init.htm")
public HmeAjax init() {
Map<String, Object> map = new HashMap<String, Object>();
// 字典信息
map.put("FrameDictArray", HmeFrameDictHelper.create().getArrayDict());
// 服务器时间
map.put("FrameCurrentTime", LocalDateTime.now());
// 系统所有参数
map.put("FrameParamArray", HmeFrameParamHelper.create().getParam());
return new HmeAjax(map);
}
}

View File

@ -1,22 +1,22 @@
package cn.tsy.cas.idsse.dsds.control.param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.hme.data.frame.mapper.IHmeFrameParamMapper;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
@RestController
@RequestMapping("param")
public class DSDSParamControl extends HmeAjaxControl{
@Autowired
private IHmeFrameParamMapper mParam;
@RequestMapping("list.htm")
public HmeAjax list() {
return new HmeAjax(this.mParam.all());
}
}
package cn.tsy.cas.idsse.dsds.control.param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.hme.data.frame.mapper.IHmeFrameParamMapper;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
@RestController
@RequestMapping("param")
public class DSDSParamControl extends HmeAjaxControl{
@Autowired
private IHmeFrameParamMapper mParam;
@RequestMapping("list.htm")
public HmeAjax list() {
return new HmeAjax(this.mParam.all());
}
}

View File

@ -1,178 +1,178 @@
package cn.tsy.cas.idsse.dsds.control.report;
import java.time.LocalDate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.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.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegReportMapper;
@RestController
@RequestMapping("report")
public class DSDSReportControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper iReg;
@Autowired
private IVoyageRegReportMapper iRegReport;
@Autowired
private IDictReportMapper iReport;
@RequestMapping("main.htm")
public HmeAjax list() {
return new HmeAjax(DSDSReportThread.map);
}
/*******************
* 返回所有配置的前端报表需要的排序
*/
@RequestMapping("type/list.htm")
public HmeAjax listType() {
return new HmeAjax(iReport.listByColumn("report_status", "Active", "report_type", "report_order"));
}
/***************
* 科考船汇总统计属性
*/
@RequestMapping("ship/total.htm")
public HmeAjax totalShip(String ship_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportShipTotal(ship_name, start, end,year));
}
/***************
* 科考船航次
*/
@RequestMapping("ship/voyage.htm")
public HmeAjax shipVoyage(String ship_name, LocalDate start, LocalDate end) {
SqlQuery query = SqlQuery.create().addOrder("voyage_start_date");
if (HmeStringHelper.hasValue(ship_name))
query.addCondition("ship_name", ship_name);
if (start != null)
query.addCondition("voyage_start_date", start, SqlConditionType.GTE);
if (end != null)
query.addCondition("voyage_start_date", end, SqlConditionType.LTE);
return new HmeAjax(this.iReg.list(query));
}
/***************
* 参航单位地图
*/
@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/hov.htm")
public HmeAjax platformHov(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformTotal("'载人潜水器'", platform_name, start, end,year));
}
/***************
* 无人航行潜水器
*/
@RequestMapping("platform/auv.htm")
public HmeAjax platformAuv(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformTotal("'水下自主式无人潜器'", platform_name, start, end,year));
}
/***************
* 遥控潜水器
*/
@RequestMapping("platform/rov.htm")
public HmeAjax platformRov(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformTotal("'遥控水下机器人'", platform_name, start, end,year));
}
/***************
* 载人潜水器
*/
@RequestMapping("platform/hov/unit.htm")
public HmeAjax platformHovUnit(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformUnit("'载人潜水器'", platform_name, start, end,year));
}
/***************
* 无人航行潜水器
*/
@RequestMapping("platform/auv/unit.htm")
public HmeAjax platformAuvUnit(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformUnit("'水下自主式无人潜器'", platform_name, start, end,year));
}
/***************
* 遥控潜水器
*/
@RequestMapping("platform/rov/unit.htm")
public HmeAjax platformRovUnit(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformUnit("'遥控水下机器人'", platform_name, start, end, year));
}
/***************
* 载人潜水器
*/
@RequestMapping("platform/hov/unit/year.htm")
public HmeAjax platformHovUnitYear(String platform_name) {
return new HmeAjax(this.iRegReport.reportPlatfromUnitWithYear("'载人潜水器'", platform_name));
}
/***************
* 无人航行潜水器
*/
@RequestMapping("platform/auv/unit/year.htm")
public HmeAjax platformAuvUnitYear(String platform_name) {
return new HmeAjax(this.iRegReport.reportPlatfromUnitWithYear("'水下自主式无人潜器'", platform_name));
}
/***************
* 遥控潜水器
*/
@RequestMapping("platform/rov/unit/year.htm")
public HmeAjax platformRovUnitYear(String platform_name) {
return new HmeAjax(this.iRegReport.reportPlatfromUnitWithYear("'遥控水下机器人'", platform_name));
}
/***************
* 载人潜水器
*/
@RequestMapping("platform/hov/diving.htm")
public HmeAjax platformHovDiving(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformDiving("'载人潜水器'", platform_name, start, end,year));
}
/***************
* 无人航行潜水器
*/
@RequestMapping("platform/auv/diving.htm")
public HmeAjax platformAuvDiving(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformDiving("'水下自主式无人潜器'", platform_name, start, end,year));
}
/***************
* 遥控潜水器
*/
@RequestMapping("platform/rov/diving.htm")
public HmeAjax platformRovDiving(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformDiving("'遥控水下机器人'", platform_name, start, end, year));
}
}
package cn.tsy.cas.idsse.dsds.control.report;
import java.time.LocalDate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.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.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegReportMapper;
@RestController
@RequestMapping("report")
public class DSDSReportControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper iReg;
@Autowired
private IVoyageRegReportMapper iRegReport;
@Autowired
private IDictReportMapper iReport;
@RequestMapping("main.htm")
public HmeAjax list() {
return new HmeAjax(DSDSReportThread.map);
}
/*******************
* 返回所有配置的前端报表需要的排序
*/
@RequestMapping("type/list.htm")
public HmeAjax listType() {
return new HmeAjax(iReport.listByColumn("report_status", "Active", "report_type", "report_order"));
}
/***************
* 科考船汇总统计属性
*/
@RequestMapping("ship/total.htm")
public HmeAjax totalShip(String ship_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportShipTotal(ship_name, start, end,year));
}
/***************
* 科考船航次
*/
@RequestMapping("ship/voyage.htm")
public HmeAjax shipVoyage(String ship_name, LocalDate start, LocalDate end) {
SqlQuery query = SqlQuery.create().addOrder("voyage_start_date");
if (HmeStringHelper.hasValue(ship_name))
query.addCondition("ship_name", ship_name);
if (start != null)
query.addCondition("voyage_start_date", start, SqlConditionType.GTE);
if (end != null)
query.addCondition("voyage_start_date", end, SqlConditionType.LTE);
return new HmeAjax(this.iReg.list(query));
}
/***************
* 参航单位地图
*/
@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/hov.htm")
public HmeAjax platformHov(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformTotal("'载人潜水器'", platform_name, start, end,year));
}
/***************
* 无人航行潜水器
*/
@RequestMapping("platform/auv.htm")
public HmeAjax platformAuv(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformTotal("'水下自主式无人潜器'", platform_name, start, end,year));
}
/***************
* 遥控潜水器
*/
@RequestMapping("platform/rov.htm")
public HmeAjax platformRov(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformTotal("'遥控水下机器人'", platform_name, start, end,year));
}
/***************
* 载人潜水器
*/
@RequestMapping("platform/hov/unit.htm")
public HmeAjax platformHovUnit(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformUnit("'载人潜水器'", platform_name, start, end,year));
}
/***************
* 无人航行潜水器
*/
@RequestMapping("platform/auv/unit.htm")
public HmeAjax platformAuvUnit(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformUnit("'水下自主式无人潜器'", platform_name, start, end,year));
}
/***************
* 遥控潜水器
*/
@RequestMapping("platform/rov/unit.htm")
public HmeAjax platformRovUnit(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformUnit("'遥控水下机器人'", platform_name, start, end, year));
}
/***************
* 载人潜水器
*/
@RequestMapping("platform/hov/unit/year.htm")
public HmeAjax platformHovUnitYear(String platform_name) {
return new HmeAjax(this.iRegReport.reportPlatfromUnitWithYear("'载人潜水器'", platform_name));
}
/***************
* 无人航行潜水器
*/
@RequestMapping("platform/auv/unit/year.htm")
public HmeAjax platformAuvUnitYear(String platform_name) {
return new HmeAjax(this.iRegReport.reportPlatfromUnitWithYear("'水下自主式无人潜器'", platform_name));
}
/***************
* 遥控潜水器
*/
@RequestMapping("platform/rov/unit/year.htm")
public HmeAjax platformRovUnitYear(String platform_name) {
return new HmeAjax(this.iRegReport.reportPlatfromUnitWithYear("'遥控水下机器人'", platform_name));
}
/***************
* 载人潜水器
*/
@RequestMapping("platform/hov/diving.htm")
public HmeAjax platformHovDiving(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformDiving("'载人潜水器'", platform_name, start, end,year));
}
/***************
* 无人航行潜水器
*/
@RequestMapping("platform/auv/diving.htm")
public HmeAjax platformAuvDiving(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformDiving("'水下自主式无人潜器'", platform_name, start, end,year));
}
/***************
* 遥控潜水器
*/
@RequestMapping("platform/rov/diving.htm")
public HmeAjax platformRovDiving(String platform_name, LocalDate start, LocalDate end,Integer year) {
return new HmeAjax(this.iRegReport.reportPlatformDiving("'遥控水下机器人'", platform_name, start, end, year));
}
}

View File

@ -1,84 +1,84 @@
package cn.tsy.cas.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.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.excel.HmeExcelReaderHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleDatasetService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
@RestController
@RequestMapping("sample/dataset")
@CrossOrigin
public class SampleDatasetControl extends HmeAjaxControl {
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private SampleDatasetService sDataset;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "create_time";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mDataset.datasetWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("find.htm")
public HmeAjax find(int dataset_id) {
return new HmeAjax(this.mDataset.find(dataset_id));
}
@RequestMapping("edit.htm")
public HmeAjax edit(SampleDataset dataset,Integer old_dataset_id) {
return new HmeAjax(this.sDataset.editDataset(dataset, old_dataset_id,DSDSWebHelper.getFrameOptr(true)));
}
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
List<List<String>> values = HmeExcelReaderHelper.readSheet(file, 1, 40);
if (values.size() == 0)
throw new BusinessException("导入的文件中无有效数据,请检查!");
this.sDataset.uploadSample(values, DSDSWebHelper.getFrameOptr(true));
return new HmeAjax();
}
// @RequestMapping("sample/list.htm")
// public HmeAjax listSample(int dataset_id) {
// SampleDataset dataset = this.mDataset.find(dataset_id);
// return new HmeAjax(this.sDataset.editDataset(dataset, getFrameOptr()));
// }
//
//
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sDataset.deleteDataset(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.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.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.excel.HmeExcelReaderHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleDatasetService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
@RestController
@RequestMapping("sample/dataset")
@CrossOrigin
public class SampleDatasetControl extends HmeAjaxControl {
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private SampleDatasetService sDataset;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "create_time";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mDataset.datasetWithPage(group, start, limit, query, order, type);
return new HmeAjax(page);
}
@RequestMapping("find.htm")
public HmeAjax find(int dataset_id) {
return new HmeAjax(this.mDataset.find(dataset_id));
}
@RequestMapping("edit.htm")
public HmeAjax edit(SampleDataset dataset,Integer old_dataset_id) {
return new HmeAjax(this.sDataset.editDataset(dataset, old_dataset_id,DSDSWebHelper.getFrameOptr(true)));
}
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
List<List<String>> values = HmeExcelReaderHelper.readSheet(file, 1, 40);
if (values.size() == 0)
throw new BusinessException("导入的文件中无有效数据,请检查!");
this.sDataset.uploadSample(values, DSDSWebHelper.getFrameOptr(true));
return new HmeAjax();
}
// @RequestMapping("sample/list.htm")
// public HmeAjax listSample(int dataset_id) {
// SampleDataset dataset = this.mDataset.find(dataset_id);
// return new HmeAjax(this.sDataset.editDataset(dataset, getFrameOptr()));
// }
//
//
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sDataset.deleteDataset(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,99 +1,99 @@
package cn.tsy.cas.idsse.dsds.control.sample;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.frame.helper.HmeWebHelper;
import cn.hme.framework.helper.io.HmeFileHelper;
import cn.hme.framework.helper.io.HmeMultipartFileHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.hme.framework.jdbc.entity.OrderBy;
import cn.hme.framework.jdbc.entity.SqlQuery;
import cn.tsy.cas.idsse.dsds.helper.DSDSParamHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleDatasetTrackService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDatasetTrack;
@RestController
@RequestMapping("sample/dataset/track")
@CrossOrigin
public class SampleDatasetTrackControl extends HmeAjaxControl {
@Autowired
private ISampleDatasetMapper mData;
@Autowired
private ISampleDatasetTrackMapper mTrack;
@Autowired
private SampleDatasetTrackService sTrack;
@RequestMapping("total.htm")
public HmeAjax total(int dataset_id) {
Map<String,Object> value = this.mTrack.totalTrack(dataset_id);
Map<String,Object> mapReturn = new HashMap<>();
if(value==null)
return new HmeAjax(mapReturn);
SampleDatasetTrack start =
this.mTrack.list(SqlQuery.create()
.addCondition("dataset_id", dataset_id)
.addCondition("track_time", value.get("min_time"))).get(0);
SampleDatasetTrack end =
this.mTrack.list(SqlQuery.create()
.addCondition("dataset_id", dataset_id)
.addCondition("track_time", value.get("max_time"))).get(0);
mapReturn.put("start", start);
mapReturn.put("end", end);
return new HmeAjax(mapReturn);
}
@RequestMapping("list.htm")
public HmeAjax list(int dataset_id) {
//return new HmeAjax(this.mTrack.selectListByColumnAndSimpleOrder("dataset_id", dataset_id, OrderBy.of("track_time")));
return new HmeAjax(this.mTrack.listTrack(dataset_id, DSDSParamHelper.DatasetNaviagtionTicketMinutes));
}
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(int dataset_id, MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
File f = HmeMultipartFileHelper.fromUpload(file);
List<String> array = HmeFileHelper.readAsArray(f.getPath());
f.delete();
List<SampleDatasetTrack> list = this.sTrack.uploadTrack(dataset_id, array,file.getOriginalFilename(), DSDSWebHelper.getFrameOptr(true));
if (list.size() == 0)
throw new BusinessException("未找到有效的轨迹文件(已忽略相同的记录)");
return new HmeAjax(file.getOriginalFilename());
}
@RequestMapping("download.htm")
public void download(int dataset_id) {
SampleDataset dataset = this.mData.find(dataset_id);
List<SampleDatasetTrack> array = this.mTrack.listByColumnWithOrder("dataset_id", dataset_id, OrderBy.of("track_time"));
List<String> values = new ArrayList<>();
for (SampleDatasetTrack nav : array) {
values.add(nav.getTrack_lon() + " " + nav.getTrack_lat() + " " + HmeLocalDateHelper.format(nav.getTrack_time()).replace(" ", "-"));
}
File tmpFile = HmeFileHelper.createTempFile();
HmeFileHelper.writeFile(tmpFile, values);
// TS2-29-1_0918-1007
HmeWebHelper.downloadFile(tmpFile, dataset.getDiving_track_file(), true);
}
}
package cn.tsy.cas.idsse.dsds.control.sample;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.frame.helper.HmeWebHelper;
import cn.hme.framework.helper.io.HmeFileHelper;
import cn.hme.framework.helper.io.HmeMultipartFileHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.hme.framework.jdbc.entity.OrderBy;
import cn.hme.framework.jdbc.entity.SqlQuery;
import cn.tsy.cas.idsse.dsds.helper.DSDSParamHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleDatasetTrackService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDatasetTrack;
@RestController
@RequestMapping("sample/dataset/track")
@CrossOrigin
public class SampleDatasetTrackControl extends HmeAjaxControl {
@Autowired
private ISampleDatasetMapper mData;
@Autowired
private ISampleDatasetTrackMapper mTrack;
@Autowired
private SampleDatasetTrackService sTrack;
@RequestMapping("total.htm")
public HmeAjax total(int dataset_id) {
Map<String,Object> value = this.mTrack.totalTrack(dataset_id);
Map<String,Object> mapReturn = new HashMap<>();
if(value==null)
return new HmeAjax(mapReturn);
SampleDatasetTrack start =
this.mTrack.list(SqlQuery.create()
.addCondition("dataset_id", dataset_id)
.addCondition("track_time", value.get("min_time"))).get(0);
SampleDatasetTrack end =
this.mTrack.list(SqlQuery.create()
.addCondition("dataset_id", dataset_id)
.addCondition("track_time", value.get("max_time"))).get(0);
mapReturn.put("start", start);
mapReturn.put("end", end);
return new HmeAjax(mapReturn);
}
@RequestMapping("list.htm")
public HmeAjax list(int dataset_id) {
//return new HmeAjax(this.mTrack.selectListByColumnAndSimpleOrder("dataset_id", dataset_id, OrderBy.of("track_time")));
return new HmeAjax(this.mTrack.listTrack(dataset_id, DSDSParamHelper.DatasetNaviagtionTicketMinutes));
}
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(int dataset_id, MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
File f = HmeMultipartFileHelper.fromUpload(file);
List<String> array = HmeFileHelper.readAsArray(f.getPath());
f.delete();
List<SampleDatasetTrack> list = this.sTrack.uploadTrack(dataset_id, array,file.getOriginalFilename(), DSDSWebHelper.getFrameOptr(true));
if (list.size() == 0)
throw new BusinessException("未找到有效的轨迹文件(已忽略相同的记录)");
return new HmeAjax(file.getOriginalFilename());
}
@RequestMapping("download.htm")
public void download(int dataset_id) {
SampleDataset dataset = this.mData.find(dataset_id);
List<SampleDatasetTrack> array = this.mTrack.listByColumnWithOrder("dataset_id", dataset_id, OrderBy.of("track_time"));
List<String> values = new ArrayList<>();
for (SampleDatasetTrack nav : array) {
values.add(nav.getTrack_lon() + " " + nav.getTrack_lat() + " " + HmeLocalDateHelper.format(nav.getTrack_time()).replace(" ", "-"));
}
File tmpFile = HmeFileHelper.createTempFile();
HmeFileHelper.writeFile(tmpFile, values);
// TS2-29-1_0918-1007
HmeWebHelper.downloadFile(tmpFile, dataset.getDiving_track_file(), true);
}
}

View File

@ -1,52 +1,62 @@
package cn.tsy.cas.idsse.dsds.control.sample;
import java.io.File;
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.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.io.HmeFileHelper;
import cn.hme.framework.helper.io.HmeMultipartFileHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleDatasetTrackService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
@RestController
@RequestMapping("sample/diving")
@CrossOrigin
public class SampleDivingControl extends HmeAjaxControl {
@Autowired
private ISampleDatasetMapper mDataset;
// @Autowired
// private ISampleDatasetTrackMapper mTrack;
@Autowired
private SampleDatasetTrackService sTrack;
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
File f = HmeMultipartFileHelper.fromUpload(file);
List<String> array = HmeFileHelper.readAsArray(f.getPath());
f.delete();
List<SampleDataset> arrayDataset = this.mDataset.listByColumn("diving_sn",
file.getOriginalFilename().replace(".txt", ""));
if (arrayDataset.size() == 0)
return new HmeAjax();
this.sTrack.uploadTrack(arrayDataset.get(0).getTsy_id(), array, file.getOriginalFilename(),
DSDSWebHelper.getFrameOptr(true));
return new HmeAjax(file.getOriginalFilename());
}
}
package cn.tsy.cas.idsse.dsds.control.sample;
import java.io.File;
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.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.io.HmeFileHelper;
import cn.hme.framework.helper.io.HmeMultipartFileHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleDatasetTrackService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
@RestController
@RequestMapping("sample/diving")
@CrossOrigin
public class SampleDivingControl extends HmeAjaxControl {
@Autowired
private ISampleDatasetMapper mDataset;
// @Autowired
// private ISampleDatasetTrackMapper mTrack;
@Autowired
private SampleDatasetTrackService sTrack;
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
File f = HmeMultipartFileHelper.fromUpload(file);
List<String> array = HmeFileHelper.readAsArray(f.getPath());
f.delete();
List<SampleDataset> arrayDataset = this.mDataset.listByColumn("diving_sn",
file.getOriginalFilename().replace(".txt", ""));
if (arrayDataset.size() == 0)
return new HmeAjax();
this.sTrack.uploadTrack(arrayDataset.get(0).getTsy_id(), array, file.getOriginalFilename(),
DSDSWebHelper.getFrameOptr(true));
return new HmeAjax(file.getOriginalFilename());
}
@CrossOrigin
@RequestMapping("list.htm")
public HmeAjax list() {
String sql = "select max(tsy_id) tsy_id,diving_sn from ("
+ "select r.*,d.dataset_id,d.track_total from sample_dataset r,(select dataset_id,count(1) track_total from sample_dataset_track group by dataset_id) d where r.tsy_id=d.dataset_id "
+ ") t group by diving_sn order by diving_sn";
return new HmeAjax(this.mDataset.listBySql(sql));
}
}

View File

@ -1,74 +1,74 @@
package cn.tsy.cas.idsse.dsds.control.sample;
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 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.OrderBy;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.helper.HmeSQLHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleLineService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
@RestController
@RequestMapping("sample/line")
@CrossOrigin
public class SampleLineControl extends HmeAjaxControl {
@Autowired
private ISampleLineMapper mLine;
@Autowired
private SampleLineService sLine;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "sample_name";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mLine.page(group,start, limit, HmeSQLHelper.makePageSqlQuery(query, order, type,
"sample_name","funding_org","sample_tag_name","sample_tag_value","sample_remark"));
return new HmeAjax(page);
}
// @RequestMapping("list.htm")
// public HmeAjax list(int dataset_id) {
// return new HmeAjax(this.mLine.selectListByColumnAndSimpleOrder("dataset_id", dataset_id, OrderBy.of("create_time", DirectionEnum.DESC)));
// }
@RequestMapping("list.htm")
public HmeAjax list(int dataset_id,String order,String type) {
if(HmeStringHelper.isEmpty(order))
order = "sample_name";
if(HmeStringHelper.isEmpty(type))
type = "DESC";
return new HmeAjax(this.mLine.listByColumnWithOrder("dataset_id", dataset_id,OrderBy.of(order, type) ));
}
@RequestMapping("edit.htm")
public HmeAjax edit(int dataset_id, SampleLine line) {
this.sLine.editLine(dataset_id, line, DSDSWebHelper.getFrameOptr(true));
return new HmeAjax(line);
}
@RequestMapping("find.htm")
public HmeAjax find(int tsy_id) {
return new HmeAjax(this.mLine.find(tsy_id));
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sLine.deleteLine(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.sample;
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 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.OrderBy;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.helper.HmeSQLHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleLineService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
@RestController
@RequestMapping("sample/line")
@CrossOrigin
public class SampleLineControl extends HmeAjaxControl {
@Autowired
private ISampleLineMapper mLine;
@Autowired
private SampleLineService sLine;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "sample_name";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mLine.page(group,start, limit, HmeSQLHelper.makePageSqlQuery(query, order, type,
"sample_name","funding_org","sample_tag_name","sample_tag_value","sample_remark"));
return new HmeAjax(page);
}
// @RequestMapping("list.htm")
// public HmeAjax list(int dataset_id) {
// return new HmeAjax(this.mLine.selectListByColumnAndSimpleOrder("dataset_id", dataset_id, OrderBy.of("create_time", DirectionEnum.DESC)));
// }
@RequestMapping("list.htm")
public HmeAjax list(int dataset_id,String order,String type) {
if(HmeStringHelper.isEmpty(order))
order = "sample_name";
if(HmeStringHelper.isEmpty(type))
type = "DESC";
return new HmeAjax(this.mLine.listByColumnWithOrder("dataset_id", dataset_id,OrderBy.of(order, type) ));
}
@RequestMapping("edit.htm")
public HmeAjax edit(int dataset_id, SampleLine line) {
this.sLine.editLine(dataset_id, line, DSDSWebHelper.getFrameOptr(true));
return new HmeAjax(line);
}
@RequestMapping("find.htm")
public HmeAjax find(int tsy_id) {
return new HmeAjax(this.mLine.find(tsy_id));
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sLine.deleteLine(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,45 +1,36 @@
package cn.tsy.cas.idsse.dsds.control.sample;
import java.io.File;
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.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.io.HmeFileHelper;
import cn.hme.framework.helper.io.HmeMultipartFileHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleLineTrackService;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLineTrack;
@RestController
@RequestMapping("sample/line/track")
@CrossOrigin
public class SampleLineTrackControl extends HmeAjaxControl {
@Autowired
private SampleLineTrackService sTrack;
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(int dataset_id, MultipartFile file) {
// DSDSWebHelper.getFrameOptr(true);
File f = HmeMultipartFileHelper.fromUpload(file);
List<String> array = HmeFileHelper.readAsArray(f.getPath());
f.delete();
List<SampleLineTrack> list = this.sTrack.uploadTrack(dataset_id, array,file.getOriginalFilename());
// if (list.size() == 0)
// throw new BusinessException("未找到有效的轨迹文件(已忽略相同的记录)");
return new HmeAjax(file.getOriginalFilename());
}
}
package cn.tsy.cas.idsse.dsds.control.sample;
import java.io.File;
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.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.io.HmeMultipartFileHelper;
@RestController
@RequestMapping("sample/line/track")
@CrossOrigin
public class SampleLineTrackControl extends HmeAjaxControl {
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(int dataset_id, MultipartFile file) {
// DSDSWebHelper.getFrameOptr(true);
File f = HmeMultipartFileHelper.fromUpload(file);
//List<String> array = HmeFileHelper.readAsArray(f.getPath());
f.delete();
//List<SampleLineTrack> list = this.sTrack.uploadTrack(dataset_id, array,file.getOriginalFilename());
// if (list.size() == 0)
// throw new BusinessException("未找到有效的轨迹文件(已忽略相同的记录)");
return new HmeAjax(file.getOriginalFilename());
}
}

View File

@ -1,67 +1,67 @@
package cn.tsy.cas.idsse.dsds.control.sample;
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 cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.OrderBy;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.helper.HmeSQLHelper;
import cn.tsy.cas.idsse.dsds.control.DSDSControl;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleStationService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleStationMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStation;
@RestController
@RequestMapping("sample/station")
@CrossOrigin
public class SampleStationControl extends DSDSControl {
@Autowired
private ISampleStationMapper mStation;
@Autowired
private SampleStationService sStation;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "sample_name";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mStation.page(group, start,limit, HmeSQLHelper.makePageSqlQuery(query, order, type,
"sample_name","funding_org","sample_tag_name","sample_tag_value","sample_remark"));
return new HmeAjax(page);
}
@RequestMapping("list.htm")
public HmeAjax list(int dataset_id,String order,String type) {
if(HmeStringHelper.isEmpty(order))
order = "sample_name";
if(HmeStringHelper.isEmpty(type))
type = "DESC";
return new HmeAjax(this.mStation.listByColumnWithOrder("dataset_id", dataset_id,OrderBy.of(order, type) ));
}
@RequestMapping("edit.htm")
public HmeAjax edit(int dataset_id, SampleStation station) {
this.sStation.editStation(dataset_id, station, getFrameOptr());
return new HmeAjax(station);
}
@RequestMapping("find.htm")
public HmeAjax find(int tsy_id) {
return new HmeAjax(this.mStation.find(tsy_id));
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sStation.deleteStation(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.sample;
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 cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.OrderBy;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.helper.HmeSQLHelper;
import cn.tsy.cas.idsse.dsds.control.DSDSControl;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.sample.SampleStationService;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleStationMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStation;
@RestController
@RequestMapping("sample/station")
@CrossOrigin
public class SampleStationControl extends DSDSControl {
@Autowired
private ISampleStationMapper mStation;
@Autowired
private SampleStationService sStation;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "sample_name";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
Pageable page = this.mStation.page(group, start,limit, HmeSQLHelper.makePageSqlQuery(query, order, type,
"sample_name","funding_org","sample_tag_name","sample_tag_value","sample_remark"));
return new HmeAjax(page);
}
@RequestMapping("list.htm")
public HmeAjax list(int dataset_id,String order,String type) {
if(HmeStringHelper.isEmpty(order))
order = "sample_name";
if(HmeStringHelper.isEmpty(type))
type = "DESC";
return new HmeAjax(this.mStation.listByColumnWithOrder("dataset_id", dataset_id,OrderBy.of(order, type) ));
}
@RequestMapping("edit.htm")
public HmeAjax edit(int dataset_id, SampleStation station) {
this.sStation.editStation(dataset_id, station, getFrameOptr());
return new HmeAjax(station);
}
@RequestMapping("find.htm")
public HmeAjax find(int tsy_id) {
return new HmeAjax(this.mStation.find(tsy_id));
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sStation.deleteStation(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,139 +1,139 @@
package cn.tsy.cas.idsse.dsds.control.search;
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 cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.lang.HmeCollectionHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictDataMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictPlatformMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
@RestController
@RequestMapping("search")
@CrossOrigin
public class SearchControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private IDictPlatformMapper mPlatform;
@Autowired
private IDictEquipmentMapper mEquipment;
@Autowired
private IDictDataMapper mData;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String search_type, String order, String type, String return_type, String search_value, Integer[] ids) {
// String where += "select t.tsy_id from sample_dataset t,voyage y where y.tsy_id=t.voyage_id";
String where = "";
if ("航次名称".equals(search_type)) {
if (ids == null || ids.length < 1) {
where += " and t.voyage_name like concat('%','" + search_value + "','%') ";
} else {
where += " and voyage_id in(" + HmeCollectionHelper.join(ids, ",") + ") ";
}
} else if ("平台类型".equals(search_type)) {
if (ids == null || ids.length < 1) {
where += " and (platform_type like concat('%','" + search_value + "','%') or platform_alias like concat('%','" + search_value + "','%')) ";
} else {
where += " and platform_id in(" + HmeCollectionHelper.join(ids, ",") + ") ";
}
} else if ("平台名称".equals(search_type)) {
where += " and platform_name like concat('%','" + search_value + "','%') ";
} else if ("设备类型".equals(search_type)) {
if (ids == null || ids.length < 1) {
where += " and (equipment_type like concat('%','" + search_value + "','%') or equipment_alias like concat('%','" + search_value + "','%')) ";
} else {
where += " and equipment_id in(" + HmeCollectionHelper.join(ids, ",") + ") ";
}
} else if ("数据集名称".equals(search_type)) {
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 + "','%')) ";
} else {
where += " and data_id in(" + HmeCollectionHelper.join(ids, ",") + ") ";
}
} 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 HmeAjax(this.mVoyage.pageBySql(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 HmeAjax(this.mVoyage.pageBySql(group, start, limit, sql));
}
}
@RequestMapping("mult.htm")
public HmeAjax mult(String search_type, Integer group, Integer limit, Integer start, String order, String type, SearchParam param) {
HmeFrameOptr optr = DSDSWebHelper.getFrameOptr(false);
if ("航次名称".endsWith(search_type))
return new HmeAjax(this.mVoyage.searchWithPage(group, start, limit, search_type, order, type,
optr == null ? null : optr.getRole_id(), optr == null ? null : optr.getOptr_id(), param));
if ("平台类型".endsWith(search_type))
return new HmeAjax(this.mPlatform.searchWithPage(group, start, limit, search_type, order, type, param));
if ("设备类型".endsWith(search_type))
return new HmeAjax(this.mEquipment.searchWithPage(group, start, limit, search_type, order, type, param));
if ("数据样品类型".endsWith(search_type))
return new HmeAjax(this.mData.searchWithPage(group, start, limit, search_type, order, type, param));
return new HmeAjax();
}
@RequestMapping("result.htm")
public HmeAjax 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 (HmeStringHelper.hasValue(param.getVoyage_name()))
where += " and t.voyage_name ='" + param.getVoyage_name() + "' ";
if (HmeStringHelper.hasValue(param.getPlatform_type()))
where += " and platform_type ='" + param.getPlatform_type() + "' ";
if (HmeStringHelper.hasValue(param.getEquipment_type()))
where += " and equipment_type ='" + param.getEquipment_type() + "' ";
if (HmeStringHelper.hasValue(param.getData_type()))
where += " and data_type ='" + param.getData_type() + "' ";
if (HmeStringHelper.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 HmeAjax(this.mVoyage.pageBySql(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 HmeAjax(this.mVoyage.pageBySql(group, start, limit, sql));
}
}
package cn.tsy.cas.idsse.dsds.control.search;
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 cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.lang.HmeCollectionHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictDataMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictPlatformMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
@RestController
@RequestMapping("search")
@CrossOrigin
public class SearchControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private IDictPlatformMapper mPlatform;
@Autowired
private IDictEquipmentMapper mEquipment;
@Autowired
private IDictDataMapper mData;
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String search_type, String order, String type, String return_type, String search_value, Integer[] ids) {
// String where += "select t.tsy_id from sample_dataset t,voyage y where y.tsy_id=t.voyage_id";
String where = "";
if ("航次名称".equals(search_type)) {
if (ids == null || ids.length < 1) {
where += " and t.voyage_name like concat('%','" + search_value + "','%') ";
} else {
where += " and voyage_id in(" + HmeCollectionHelper.join(ids, ",") + ") ";
}
} else if ("平台类型".equals(search_type)) {
if (ids == null || ids.length < 1) {
where += " and (platform_type like concat('%','" + search_value + "','%') or platform_alias like concat('%','" + search_value + "','%')) ";
} else {
where += " and platform_id in(" + HmeCollectionHelper.join(ids, ",") + ") ";
}
} else if ("平台名称".equals(search_type)) {
where += " and platform_name like concat('%','" + search_value + "','%') ";
} else if ("设备类型".equals(search_type)) {
if (ids == null || ids.length < 1) {
where += " and (equipment_type like concat('%','" + search_value + "','%') or equipment_alias like concat('%','" + search_value + "','%')) ";
} else {
where += " and equipment_id in(" + HmeCollectionHelper.join(ids, ",") + ") ";
}
} else if ("数据集名称".equals(search_type)) {
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 + "','%')) ";
} else {
where += " and data_id in(" + HmeCollectionHelper.join(ids, ",") + ") ";
}
} 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 HmeAjax(this.mVoyage.pageBySql(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 HmeAjax(this.mVoyage.pageBySql(group, start, limit, sql));
}
}
@RequestMapping("mult.htm")
public HmeAjax mult(String search_type, Integer group, Integer limit, Integer start, String order, String type, SearchParam param) {
HmeFrameOptr optr = DSDSWebHelper.getFrameOptr(false);
if ("航次名称".endsWith(search_type))
return new HmeAjax(this.mVoyage.searchWithPage(group, start, limit, search_type, order, type,
optr == null ? null : optr.getRole_id(), optr == null ? null : optr.getOptr_id(), param));
if ("平台类型".endsWith(search_type))
return new HmeAjax(this.mPlatform.searchWithPage(group, start, limit, search_type, order, type, param));
if ("设备类型".endsWith(search_type))
return new HmeAjax(this.mEquipment.searchWithPage(group, start, limit, search_type, order, type, param));
if ("数据样品类型".endsWith(search_type))
return new HmeAjax(this.mData.searchWithPage(group, start, limit, search_type, order, type, param));
return new HmeAjax();
}
@RequestMapping("result.htm")
public HmeAjax 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 (HmeStringHelper.hasValue(param.getVoyage_name()))
where += " and t.voyage_name ='" + param.getVoyage_name() + "' ";
if (HmeStringHelper.hasValue(param.getPlatform_type()))
where += " and platform_type ='" + param.getPlatform_type() + "' ";
if (HmeStringHelper.hasValue(param.getEquipment_type()))
where += " and equipment_type ='" + param.getEquipment_type() + "' ";
if (HmeStringHelper.hasValue(param.getData_type()))
where += " and data_type ='" + param.getData_type() + "' ";
if (HmeStringHelper.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 HmeAjax(this.mVoyage.pageBySql(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 HmeAjax(this.mVoyage.pageBySql(group, start, limit, sql));
}
}
}

View File

@ -1,105 +1,105 @@
package cn.tsy.cas.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;
}
}
package cn.tsy.cas.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;
}
}

View File

@ -1,102 +1,102 @@
package cn.tsy.cas.idsse.dsds.control.voyage;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
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.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.excel.HmeExcel2007Writer;
import cn.hme.framework.helper.excel.HmeExcelReaderHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.voyage.VoyageMemberService;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@RestController
@RequestMapping("voyage/member")
@CrossOrigin
public class VoyageMemberControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper mReg;
@Autowired
private IVoyageMemberMapper mMember;
@Autowired
private VoyageMemberService sMember;
@RequestMapping("page.htm")
public HmeAjax page(int voyage_id, Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "tsy_id";
Pageable page = this.mMember.memberWithPage(group, start, limit, query, order, type, voyage_id);
return new HmeAjax(page);
}
@RequestMapping("edit.htm")
public HmeAjax edit(VoyageMember member) {
DSDSWebHelper.getFrameOptr(true);
this.sMember.editMember(member);
return new HmeAjax();
}
@RequestMapping("delete.htm")
public HmeAjax delete(int member_id) {
DSDSWebHelper.getFrameOptr(true);
this.sMember.deleteMember(member_id);
return new HmeAjax();
}
@RequestMapping("list.htm")
public HmeAjax list(int voyage_id) {
return new HmeAjax(this.mMember.listByColumn("voyage_id", voyage_id,"tsy_id"));
}
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(int voyage_id, MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
List<List<String>> values = HmeExcelReaderHelper.readSheet(file,1, 12);
List<VoyageMember> list = this.sMember.uploadMember(voyage_id, values, DSDSWebHelper.getFrameOptr(true));
if (list.size() == 0)
throw new BusinessException("未找到有效的参航人员记录!");
return new HmeAjax();
}
@RequestMapping("download.htm")
public void download(int voyage_id) {
VoyageReg voyage = this.mReg.find(voyage_id);
List<VoyageMember> array = this.mMember.listByColumn("voyage_id", voyage_id, "tsy_id");
// 姓名 性别 出生日期 单位 岗位职责 船上床号 联系电话 证件号码 银卡名称 银行卡号码 开户行 备注信息
Map<String, Integer> titleMap = HmeExcel2007Writer.createTitleMap("姓名", 20);
titleMap.put("性别", 8);
titleMap.put("出生日期", 14);
titleMap.put("单位", 30);
titleMap.put("岗位职责", 20);
List<List<Object>> values = new ArrayList<List<Object>>();
for(VoyageMember m:array) {
List<Object> vs = new ArrayList<Object>();
vs.add(m.getMember_name());
vs.add(m.getMember_sex());
vs.add(m.getMember_birthday());
vs.add(m.getMember_unit());
vs.add(m.getMember_dept());
values.add(vs);
}
HmeExcel2007Writer.downloadAsExcel(this.getResponse(),voyage.getVoyage_name() + "_参航人员名单",values, titleMap);
}
}
package cn.tsy.cas.idsse.dsds.control.voyage;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
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.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.excel.HmeExcel2007Writer;
import cn.hme.framework.helper.excel.HmeExcelReaderHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.voyage.VoyageMemberService;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@RestController
@RequestMapping("voyage/member")
@CrossOrigin
public class VoyageMemberControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper mReg;
@Autowired
private IVoyageMemberMapper mMember;
@Autowired
private VoyageMemberService sMember;
@RequestMapping("page.htm")
public HmeAjax page(int voyage_id, Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "tsy_id";
Pageable page = this.mMember.memberWithPage(group, start, limit, query, order, type, voyage_id);
return new HmeAjax(page);
}
@RequestMapping("edit.htm")
public HmeAjax edit(VoyageMember member) {
DSDSWebHelper.getFrameOptr(true);
this.sMember.editMember(member);
return new HmeAjax();
}
@RequestMapping("delete.htm")
public HmeAjax delete(int member_id) {
DSDSWebHelper.getFrameOptr(true);
this.sMember.deleteMember(member_id);
return new HmeAjax();
}
@RequestMapping("list.htm")
public HmeAjax list(int voyage_id) {
return new HmeAjax(this.mMember.listByColumn("voyage_id", voyage_id,"tsy_id"));
}
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(int voyage_id, MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
List<List<String>> values = HmeExcelReaderHelper.readSheet(file,1, 12);
List<VoyageMember> list = this.sMember.uploadMember(voyage_id, values, DSDSWebHelper.getFrameOptr(true));
if (list.size() == 0)
throw new BusinessException("未找到有效的参航人员记录!");
return new HmeAjax();
}
@RequestMapping("download.htm")
public void download(int voyage_id) {
VoyageReg voyage = this.mReg.find(voyage_id);
List<VoyageMember> array = this.mMember.listByColumn("voyage_id", voyage_id, "tsy_id");
// 姓名 性别 出生日期 单位 岗位职责 船上床号 联系电话 证件号码 银卡名称 银行卡号码 开户行 备注信息
Map<String, Integer> titleMap = HmeExcel2007Writer.createTitleMap("姓名", 20);
titleMap.put("性别", 8);
titleMap.put("出生日期", 14);
titleMap.put("单位", 30);
titleMap.put("岗位职责", 20);
List<List<Object>> values = new ArrayList<List<Object>>();
for(VoyageMember m:array) {
List<Object> vs = new ArrayList<Object>();
vs.add(m.getMember_name());
vs.add(m.getMember_sex());
vs.add(m.getMember_birthday());
vs.add(m.getMember_unit());
vs.add(m.getMember_dept());
values.add(vs);
}
HmeExcel2007Writer.downloadAsExcel(this.getResponse(),voyage.getVoyage_name() + "_参航人员名单",values, titleMap);
}
}

View File

@ -1,118 +1,118 @@
package cn.tsy.cas.idsse.dsds.control.voyage;
import java.io.File;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.frame.helper.HmeWebHelper;
import cn.hme.framework.helper.io.HmeFileHelper;
import cn.hme.framework.helper.io.HmeMultipartFileHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.entity.SqlQuery;
import cn.tsy.cas.idsse.dsds.helper.DSDSGeoCalculator;
import cn.tsy.cas.idsse.dsds.helper.DSDSParamHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.voyage.VoyageNavigationService;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageNavigationMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageNavigation;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@RestController
@RequestMapping("voyage/navigation")
@CrossOrigin
public class VoyageNavigationControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper mReg;
@Autowired
private IVoyageNavigationMapper mNavigation;
@Autowired
private VoyageNavigationService sNav;
@RequestMapping("page.htm")
public HmeAjax page(int voyage_id, Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "nav_time";
Pageable page = this.mNavigation.navigationWithPage(group, start, limit, query, order, type, voyage_id);
return new HmeAjax(page);
}
@RequestMapping("list.htm")
public HmeAjax list(int voyage_id) {
//return new HmeAjax(this.mNavigation.selectListByColumnAndSimpleOrder("voyage_id", voyage_id, OrderBy.of("nav_time")));
return new HmeAjax(this.mNavigation.listNavigation(voyage_id, DSDSParamHelper.VaoyageNaviagtionTicketMinutes));
}
@RequestMapping("mileage.htm")
public HmeAjax mileage(int voyage_id) {
Double value = DSDSGeoCalculator.calcuateVoyage(
this.mNavigation.listByColumn("voyage_id", voyage_id, "nav_time"));
if(value!=null && value>0) {
VoyageReg voyage = new VoyageReg();
voyage.setTsy_id(voyage_id);
voyage.setVoyage_mileage(value.intValue());
this.mReg.update(voyage);
}
return new HmeAjax();
}
@RequestMapping("total.htm")
public HmeAjax total(int voyage_id) {
Map<String,Object> value = this.mNavigation.totalNavigation(voyage_id);
Map<String,Object> mapReturn = new HashMap<>();
if(value==null)
return new HmeAjax(mapReturn);
VoyageNavigation start = this.mNavigation.list(SqlQuery.create().addCondition("voyage_id", voyage_id)
.addCondition("nav_time", value.get("min_time"))).get(0);
VoyageNavigation end = this.mNavigation.list(SqlQuery.create().addCondition("voyage_id", voyage_id)
.addCondition("nav_time", value.get("max_time"))).get(0);
mapReturn.put("start", start);
mapReturn.put("end", end);
return new HmeAjax(mapReturn);
}
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(int voyage_id, MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
File f = HmeMultipartFileHelper.fromUpload(file);
List<String> array = HmeFileHelper.readAsArray(f.getPath());
f.delete();
List<VoyageNavigation> list = this.sNav.uploadNavigation(voyage_id, array,file.getOriginalFilename(), DSDSWebHelper.getFrameOptr(true));
if (list.size() == 0)
throw new BusinessException("未找到有效的导航记录(已忽略相同的记录)");
return new HmeAjax(file.getOriginalFilename());
}
@RequestMapping("download.htm")
public void download(int voyage_id) {
VoyageReg voyage = this.mReg.find(voyage_id);
List<VoyageNavigation> array = this.mNavigation.listByColumn("voyage_id", voyage_id, "nav_time");
List<String> values = new ArrayList<>();
for (VoyageNavigation nav : array) {
values.add(nav.getNav_lon() + " " + nav.getNav_lat() + " " + HmeLocalDateHelper.format(nav.getNav_time()).replace(" ", "-"));
}
File tmpFile = HmeFileHelper.createTempFile();
HmeFileHelper.writeFile(tmpFile, values);
// TS2-29-1_0918-1007
DateTimeFormatter ft = DateTimeFormatter.ofPattern("MMdd");
HmeWebHelper.downloadFile(tmpFile, voyage.getVoyage_name() + "_" + voyage.getVoyage_start_date().format(ft) + "-" + voyage.getVoyage_end_date().format(ft)+".txt", true);
}
}
package cn.tsy.cas.idsse.dsds.control.voyage;
import java.io.File;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.frame.helper.HmeWebHelper;
import cn.hme.framework.helper.io.HmeFileHelper;
import cn.hme.framework.helper.io.HmeMultipartFileHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.entity.SqlQuery;
import cn.tsy.cas.idsse.dsds.helper.DSDSGeoCalculator;
import cn.tsy.cas.idsse.dsds.helper.DSDSParamHelper;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.voyage.VoyageNavigationService;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageNavigationMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageNavigation;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@RestController
@RequestMapping("voyage/navigation")
@CrossOrigin
public class VoyageNavigationControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper mReg;
@Autowired
private IVoyageNavigationMapper mNavigation;
@Autowired
private VoyageNavigationService sNav;
@RequestMapping("page.htm")
public HmeAjax page(int voyage_id, Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "nav_time";
Pageable page = this.mNavigation.navigationWithPage(group, start, limit, query, order, type, voyage_id);
return new HmeAjax(page);
}
@RequestMapping("list.htm")
public HmeAjax list(int voyage_id) {
//return new HmeAjax(this.mNavigation.selectListByColumnAndSimpleOrder("voyage_id", voyage_id, OrderBy.of("nav_time")));
return new HmeAjax(this.mNavigation.listNavigation(voyage_id, DSDSParamHelper.VaoyageNaviagtionTicketMinutes));
}
@RequestMapping("mileage.htm")
public HmeAjax mileage(int voyage_id) {
Double value = DSDSGeoCalculator.calcuateVoyage(
this.mNavigation.listByColumn("voyage_id", voyage_id, "nav_time"));
if(value!=null && value>0) {
VoyageReg voyage = new VoyageReg();
voyage.setTsy_id(voyage_id);
voyage.setVoyage_mileage(value.intValue());
this.mReg.update(voyage);
}
return new HmeAjax();
}
@RequestMapping("total.htm")
public HmeAjax total(int voyage_id) {
Map<String,Object> value = this.mNavigation.totalNavigation(voyage_id);
Map<String,Object> mapReturn = new HashMap<>();
if(value==null)
return new HmeAjax(mapReturn);
VoyageNavigation start = this.mNavigation.list(SqlQuery.create().addCondition("voyage_id", voyage_id)
.addCondition("nav_time", value.get("min_time"))).get(0);
VoyageNavigation end = this.mNavigation.list(SqlQuery.create().addCondition("voyage_id", voyage_id)
.addCondition("nav_time", value.get("max_time"))).get(0);
mapReturn.put("start", start);
mapReturn.put("end", end);
return new HmeAjax(mapReturn);
}
@CrossOrigin
@RequestMapping("upload.htm")
public HmeAjax upload(int voyage_id, MultipartFile file) {
DSDSWebHelper.getFrameOptr(true);
File f = HmeMultipartFileHelper.fromUpload(file);
List<String> array = HmeFileHelper.readAsArray(f.getPath());
f.delete();
List<VoyageNavigation> list = this.sNav.uploadNavigation(voyage_id, array,file.getOriginalFilename(), DSDSWebHelper.getFrameOptr(true));
if (list.size() == 0)
throw new BusinessException("未找到有效的导航记录(已忽略相同的记录)");
return new HmeAjax(file.getOriginalFilename());
}
@RequestMapping("download.htm")
public void download(int voyage_id) {
VoyageReg voyage = this.mReg.find(voyage_id);
List<VoyageNavigation> array = this.mNavigation.listByColumn("voyage_id", voyage_id, "nav_time");
List<String> values = new ArrayList<>();
for (VoyageNavigation nav : array) {
values.add(nav.getNav_lon() + " " + nav.getNav_lat() + " " + HmeLocalDateHelper.format(nav.getNav_time()).replace(" ", "-"));
}
File tmpFile = HmeFileHelper.createTempFile();
HmeFileHelper.writeFile(tmpFile, values);
// TS2-29-1_0918-1007
DateTimeFormatter ft = DateTimeFormatter.ofPattern("MMdd");
HmeWebHelper.downloadFile(tmpFile, voyage.getVoyage_name() + "_" + voyage.getVoyage_start_date().format(ft) + "-" + voyage.getVoyage_end_date().format(ft)+".txt", true);
}
}

View File

@ -1,95 +1,95 @@
package cn.tsy.cas.idsse.dsds.control.voyage;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.excel.HmeExcelReaderHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.voyage.VoyageRegService;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@RestController
@RequestMapping("voyage/reg")
@CrossOrigin
public class VoyageRegControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private VoyageRegService sVoyage;
@Autowired
private IVoyageMemberMapper mMember;
@CrossOrigin
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "voyage_end_date";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
HmeFrameOptr optr = DSDSWebHelper.getFrameOptr(false);
Pageable page = this.mVoyage.voyageWithPage(group, start, limit, query, order, type,
optr == null ? null : optr.getRole_id(), optr == null ? null : optr.getOptr_id());
return new HmeAjax(page);
}
@RequestMapping("edit.htm")
public HmeAjax edit(VoyageReg voyage) {
this.sVoyage.editVoyage(voyage, DSDSWebHelper.getFrameOptr(true));
return new HmeAjax(voyage);
}
@CrossOrigin
@RequestMapping("list.htm")
public HmeAjax list() {
return new HmeAjax(this.mVoyage.all("voyage_name"));
}
@RequestMapping("upload.htm")
public HmeAjax upload(MultipartFile file) {
// DSDSWebHelper.getFrameOptr(true);
List<List<String>> values = HmeExcelReaderHelper.readSheet(file, 1, 40);
if (values.size() == 0)
throw new BusinessException("导入的文件中无有效数据,请检查!");
return new HmeAjax(this.sVoyage.uploadVoyage(values).size());
}
@RequestMapping("info.htm")
public HmeAjax info(String voyage_name) {
VoyageReg voyage = this.mVoyage.findByColumn("voyage_name", voyage_name);
Map<String, Object> mapReturn = new HashMap<>();
mapReturn.put("voyage", voyage);
String sql = "select platform_type,platform_alias,platform_name,count(1) platform_total from sample_dataset where voyage_id=? group by platform_type,platform_alias,platform_name order by count(1) desc";
mapReturn.put("PlatformArray", this.mVoyage.mapBySql(sql, voyage.getTsy_id()));
sql = "select equipment_type,equipment_alias,count(1) equipment_total from sample_dataset where voyage_id=? group by equipment_type,equipment_alias order by count(1) desc";
mapReturn.put("EquipmentArray", this.mVoyage.mapBySql(sql, voyage.getTsy_id()));
sql = "select dataset_name,platform_type,platform_alias,equipment_type,equipment_alias,count(1) data_total,data_type,data_alias,job_type from sample_dataset where voyage_id=? group by platform_type,platform_alias,equipment_type,equipment_alias,dataset_name,data_type,data_alias,job_type order by count(1) desc";
mapReturn.put("DatasetArray", this.mVoyage.mapBySql(sql, voyage.getTsy_id()));
mapReturn.put("MemberArray", this.mMember.listByColumn("voyage_id", voyage.getTsy_id(), "tsy_id"));
HmeAjax HmeAjax = new HmeAjax();
HmeAjax.setMap(mapReturn);
return HmeAjax;
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sVoyage.deleteVoyage(tsy_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.voyage;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.hme.framework.helper.excel.HmeExcelReaderHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.voyage.VoyageRegService;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@RestController
@RequestMapping("voyage/reg")
@CrossOrigin
public class VoyageRegControl extends HmeAjaxControl {
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private VoyageRegService sVoyage;
@Autowired
private IVoyageMemberMapper mMember;
@CrossOrigin
@RequestMapping("page.htm")
public HmeAjax page(Integer group, Integer limit, Integer start, String query, String order, String type) {
order = HmeStringHelper.hasValue(order) ? order : "voyage_end_date";
type = HmeStringHelper.hasValue(type) ? type : "DESC";
HmeFrameOptr optr = DSDSWebHelper.getFrameOptr(false);
Pageable page = this.mVoyage.voyageWithPage(group, start, limit, query, order, type,
optr == null ? null : optr.getRole_id(), optr == null ? null : optr.getOptr_id());
return new HmeAjax(page);
}
@RequestMapping("edit.htm")
public HmeAjax edit(VoyageReg voyage) {
this.sVoyage.editVoyage(voyage, DSDSWebHelper.getFrameOptr(true));
return new HmeAjax(voyage);
}
@CrossOrigin
@RequestMapping("list.htm")
public HmeAjax list() {
return new HmeAjax(this.mVoyage.all("voyage_name"));
}
@RequestMapping("upload.htm")
public HmeAjax upload(MultipartFile file) {
// DSDSWebHelper.getFrameOptr(true);
List<List<String>> values = HmeExcelReaderHelper.readSheet(file, 1, 40);
if (values.size() == 0)
throw new BusinessException("导入的文件中无有效数据,请检查!");
return new HmeAjax(this.sVoyage.uploadVoyage(values).size());
}
@RequestMapping("info.htm")
public HmeAjax info(String voyage_name) {
VoyageReg voyage = this.mVoyage.findByColumn("voyage_name", voyage_name);
Map<String, Object> mapReturn = new HashMap<>();
mapReturn.put("voyage", voyage);
String sql = "select platform_type,platform_alias,platform_name,count(1) platform_total from sample_dataset where voyage_id=? group by platform_type,platform_alias,platform_name order by count(1) desc";
mapReturn.put("PlatformArray", this.mVoyage.mapBySql(sql, voyage.getTsy_id()));
sql = "select equipment_type,equipment_alias,count(1) equipment_total from sample_dataset where voyage_id=? group by equipment_type,equipment_alias order by count(1) desc";
mapReturn.put("EquipmentArray", this.mVoyage.mapBySql(sql, voyage.getTsy_id()));
sql = "select dataset_name,platform_type,platform_alias,equipment_type,equipment_alias,count(1) data_total,data_type,data_alias,job_type from sample_dataset where voyage_id=? group by platform_type,platform_alias,equipment_type,equipment_alias,dataset_name,data_type,data_alias,job_type order by count(1) desc";
mapReturn.put("DatasetArray", this.mVoyage.mapBySql(sql, voyage.getTsy_id()));
mapReturn.put("MemberArray", this.mMember.listByColumn("voyage_id", voyage.getTsy_id(), "tsy_id"));
HmeAjax HmeAjax = new HmeAjax();
HmeAjax.setMap(mapReturn);
return HmeAjax;
}
@RequestMapping("delete.htm")
public HmeAjax delete(int tsy_id) {
DSDSWebHelper.getFrameOptr(true);
this.sVoyage.deleteVoyage(tsy_id);
return new HmeAjax();
}
}

View File

@ -1,44 +1,44 @@
package cn.tsy.cas.idsse.dsds.control.voyage;
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 cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.voyage.VoyageRegOptrService;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegOptrMapper;
@RestController
@RequestMapping("voyage/reg/optr")
@CrossOrigin
public class VoyageRegOptrControl extends HmeAjaxControl {
@Autowired
private IVoyageRegOptrMapper iOptr;
@Autowired
private VoyageRegOptrService sVoyage;
@RequestMapping("list.htm")
public HmeAjax list(int optr_id) {
return new HmeAjax(this.iOptr.listVoyage(optr_id));
}
@RequestMapping("grant.htm")
public HmeAjax edit(int optr_id, Integer voyage_ids[]) {
DSDSWebHelper.getFrameOptr(true);
this.sVoyage.save(optr_id, voyage_ids);
return new HmeAjax(this.iOptr.listVoyage(optr_id));
}
@RequestMapping("clear.htm")
public HmeAjax edit(int optr_id) {
DSDSWebHelper.getFrameOptr(true);
this.sVoyage.clear(optr_id);
return new HmeAjax();
}
}
package cn.tsy.cas.idsse.dsds.control.voyage;
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 cn.hme.framework.frame.control.HmeAjax;
import cn.hme.framework.frame.control.HmeAjaxControl;
import cn.tsy.cas.idsse.dsds.helper.DSDSWebHelper;
import cn.tsy.cas.idsse.dsds.service.voyage.VoyageRegOptrService;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegOptrMapper;
@RestController
@RequestMapping("voyage/reg/optr")
@CrossOrigin
public class VoyageRegOptrControl extends HmeAjaxControl {
@Autowired
private IVoyageRegOptrMapper iOptr;
@Autowired
private VoyageRegOptrService sVoyage;
@RequestMapping("list.htm")
public HmeAjax list(int optr_id) {
return new HmeAjax(this.iOptr.listVoyage(optr_id));
}
@RequestMapping("grant.htm")
public HmeAjax edit(int optr_id, Integer voyage_ids[]) {
DSDSWebHelper.getFrameOptr(true);
this.sVoyage.save(optr_id, voyage_ids);
return new HmeAjax(this.iOptr.listVoyage(optr_id));
}
@RequestMapping("clear.htm")
public HmeAjax edit(int optr_id) {
DSDSWebHelper.getFrameOptr(true);
this.sVoyage.clear(optr_id);
return new HmeAjax();
}
}

View File

@ -1,53 +1,53 @@
package cn.tsy.cas.idsse.dsds.helper;
import java.util.List;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageNavigation;
public class DSDSGeoCalculator {
// 地球半径单位为海里
private static final double EARTH_RADIUS = 3440;
/**
* 计算两点之间的距离结果以海里为单位
*
* @param lat1 第一个点的纬度
* @param lon1 第一个点的经度
* @param lat2 第二个点的纬度
* @param lon2 第二个点的经度
* @return 两点之间的距离单位为海里
*/
public static double calculateDistanceInNauticalMiles(double lat1, double lon1, double lat2, double lon2) {
double latDistance = Math.toRadians(lat2 - lat1);
double lonDistance = Math.toRadians(lon2 - lon1);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = EARTH_RADIUS * c;
return distance;
}
public static double calcuateVoyage(List<VoyageNavigation> list) {
if (list.size() < 2)
return 0d;
double distance = 0;
for (int i = 0; i < list.size()-1; i++) {
distance += calculateDistanceInNauticalMiles(Double.parseDouble(list.get(i).getNav_lat()),
Double.parseDouble(list.get(i).getNav_lon()),
Double.parseDouble(list.get(i+1).getNav_lat()),
Double.parseDouble(list.get(i+1).getNav_lon()));
}
return distance;
}
// public static void main(String[] args) {
// // 示例经纬度
// double lat1 = 40.7128;
// double lon1 = -74.0060;
// double lat2 = 40.7829;
// double lon2 = -73.9654;
//
// double distance = calculateDistanceInNauticalMiles(lat1, lon1, lat2, lon2);
// System.out.println("Distance in nautical miles: " + distance);
// }
}
package cn.tsy.cas.idsse.dsds.helper;
import java.util.List;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageNavigation;
public class DSDSGeoCalculator {
// 地球半径单位为海里
private static final double EARTH_RADIUS = 3440;
/**
* 计算两点之间的距离结果以海里为单位
*
* @param lat1 第一个点的纬度
* @param lon1 第一个点的经度
* @param lat2 第二个点的纬度
* @param lon2 第二个点的经度
* @return 两点之间的距离单位为海里
*/
public static double calculateDistanceInNauticalMiles(double lat1, double lon1, double lat2, double lon2) {
double latDistance = Math.toRadians(lat2 - lat1);
double lonDistance = Math.toRadians(lon2 - lon1);
double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = EARTH_RADIUS * c;
return distance;
}
public static double calcuateVoyage(List<VoyageNavigation> list) {
if (list.size() < 2)
return 0d;
double distance = 0;
for (int i = 0; i < list.size()-1; i++) {
distance += calculateDistanceInNauticalMiles(Double.parseDouble(list.get(i).getNav_lat()),
Double.parseDouble(list.get(i).getNav_lon()),
Double.parseDouble(list.get(i+1).getNav_lat()),
Double.parseDouble(list.get(i+1).getNav_lon()));
}
return distance;
}
// public static void main(String[] args) {
// // 示例经纬度
// double lat1 = 40.7128;
// double lon1 = -74.0060;
// double lat2 = 40.7829;
// double lon2 = -73.9654;
//
// double distance = calculateDistanceInNauticalMiles(lat1, lon1, lat2, lon2);
// System.out.println("Distance in nautical miles: " + distance);
// }
}

View File

@ -1,17 +1,17 @@
package cn.tsy.cas.idsse.dsds.helper;
public class DSDSParamHelper {
/****************
* 航次间隔时间单位分钟
*/
public static int VaoyageNaviagtionTicketMinutes = 5;
/****************
* 航次间隔时间单位分钟
*/
public static int DatasetNaviagtionTicketMinutes = 1;
/****************
* 首页统计时间间隔单位秒
*/
public static int ReportMainTicketSeconds = 5 * 60;
}
package cn.tsy.cas.idsse.dsds.helper;
public class DSDSParamHelper {
/****************
* 航次间隔时间单位分钟
*/
public static int VaoyageNaviagtionTicketMinutes = 5;
/****************
* 航次间隔时间单位分钟
*/
public static int DatasetNaviagtionTicketMinutes = 1;
/****************
* 首页统计时间间隔单位秒
*/
public static int ReportMainTicketSeconds = 5 * 60;
}

View File

@ -1,31 +1,31 @@
package cn.tsy.cas.idsse.dsds.helper;
import cn.hme.data.frame.mapper.IHmeFrameOptrMapper;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.frame.helper.HmeWebHelper;
import cn.hme.framework.helper.core.HmeSpringHelper;
import cn.hme.framework.web.context.HmeWebAppParamerter;
import cn.hme.framework.web.exception.LoginTimeoutException;
public class DSDSWebHelper {
/*******************
* 获取系统操作员并根据参数选择是否进行判断
*/
public static HmeFrameOptr getFrameOptr(boolean check) {
HmeFrameOptr optr = null;
try {
optr = (HmeFrameOptr) HmeWebHelper.getSession().getAttribute(HmeWebAppParamerter.SessionName_OptrName);
} catch (Exception e) {
}
if (check && optr == null) {
if (HmeWebAppParamerter.AutoLoginWithAdmin) {
optr = HmeSpringHelper.getBean(IHmeFrameOptrMapper.class).find(1);
HmeWebHelper.getSession().setAttribute(HmeWebAppParamerter.SessionName_OptrName, optr);
}
else
throw new LoginTimeoutException();
}
return optr;
}
}
package cn.tsy.cas.idsse.dsds.helper;
import cn.hme.data.frame.mapper.IHmeFrameOptrMapper;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.frame.helper.HmeWebHelper;
import cn.hme.framework.helper.core.HmeSpringHelper;
import cn.hme.framework.web.context.HmeWebAppParamerter;
import cn.hme.framework.web.exception.LoginTimeoutException;
public class DSDSWebHelper {
/*******************
* 获取系统操作员并根据参数选择是否进行判断
*/
public static HmeFrameOptr getFrameOptr(boolean check) {
HmeFrameOptr optr = null;
try {
optr = (HmeFrameOptr) HmeWebHelper.getSession().getAttribute(HmeWebAppParamerter.SessionName_OptrName);
} catch (Exception e) {
}
if (check && optr == null) {
if (HmeWebAppParamerter.AutoLoginWithAdmin) {
optr = HmeSpringHelper.getBean(IHmeFrameOptrMapper.class).find(1);
HmeWebHelper.getSession().setAttribute(HmeWebAppParamerter.SessionName_OptrName, optr);
}
else
throw new LoginTimeoutException();
}
return optr;
}
}

View File

@ -1,47 +1,47 @@
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictDataMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictData;
@Service
public class DictDataService {
@Autowired
private IDictDataMapper mData;
/***********************
* 增加或者修改
*/
public void editData(DictData data) {
HmeFrameAssertHelper.isNotEmpty(data.getData_name(), "数据样本类型名称不允许为空!");
// 判断类型是否存在
List<DictData> list = this.mData.listByColumn("data_name", data.getData_name());
if (data.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - data.getTsy_id() != 0)
throw new BusinessException("数据样本类型名称【" + data.getData_name() + "】已经存在,请检查!");
this.mData.update(data);
} else {
HmeFrameAssertHelper.isEmpty(list, "数据样本类型名称【" + data.getData_name() + "】已经存在,请检查!");
data.setCreate_time(LocalDateTime.now());
this.mData.insert(data);
}
}
/*****************************
* 删除
*/
public void deleteData(int data_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mData.delete(data_id);
}
}
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictDataMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictData;
@Service
public class DictDataService {
@Autowired
private IDictDataMapper mData;
/***********************
* 增加或者修改
*/
public void editData(DictData data) {
HmeFrameAssertHelper.isNotEmpty(data.getData_name(), "数据样本类型名称不允许为空!");
// 判断类型是否存在
List<DictData> list = this.mData.listByColumn("data_name", data.getData_name());
if (data.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - data.getTsy_id() != 0)
throw new BusinessException("数据样本类型名称【" + data.getData_name() + "】已经存在,请检查!");
this.mData.update(data);
} else {
HmeFrameAssertHelper.isEmpty(list, "数据样本类型名称【" + data.getData_name() + "】已经存在,请检查!");
data.setCreate_time(LocalDateTime.now());
this.mData.insert(data);
}
}
/*****************************
* 删除
*/
public void deleteData(int data_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mData.delete(data_id);
}
}

View File

@ -1,47 +1,47 @@
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictEquipment;
@Service
public class DictEquipmentService {
@Autowired
private IDictEquipmentMapper mEquipment;
/***********************
* 增加或者修改
*/
public void editEquipment(DictEquipment equipment) {
HmeFrameAssertHelper.isNotEmpty(equipment.getEquipment_name(), "设备类型名称不允许为空!");
// 判断类型是否存在
List<DictEquipment> list = this.mEquipment.listByColumn("equipment_name", equipment.getEquipment_name());
if (equipment.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - equipment.getTsy_id() != 0)
throw new BusinessException("设备类型名称【" + equipment.getEquipment_name() + "】已经存在,请检查!");
this.mEquipment.update(equipment);
} else {
HmeFrameAssertHelper.isEmpty(list, "设备类型名称【" + equipment.getEquipment_name() + "】已经存在,请检查!");
equipment.setCreate_time(LocalDateTime.now());
this.mEquipment.insert(equipment);
}
}
/*****************************
* 删除
*/
public void deleteEquipment(int equipment_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mEquipment.delete(equipment_id);
}
}
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictEquipment;
@Service
public class DictEquipmentService {
@Autowired
private IDictEquipmentMapper mEquipment;
/***********************
* 增加或者修改
*/
public void editEquipment(DictEquipment equipment) {
HmeFrameAssertHelper.isNotEmpty(equipment.getEquipment_name(), "设备类型名称不允许为空!");
// 判断类型是否存在
List<DictEquipment> list = this.mEquipment.listByColumn("equipment_name", equipment.getEquipment_name());
if (equipment.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - equipment.getTsy_id() != 0)
throw new BusinessException("设备类型名称【" + equipment.getEquipment_name() + "】已经存在,请检查!");
this.mEquipment.update(equipment);
} else {
HmeFrameAssertHelper.isEmpty(list, "设备类型名称【" + equipment.getEquipment_name() + "】已经存在,请检查!");
equipment.setCreate_time(LocalDateTime.now());
this.mEquipment.insert(equipment);
}
}
/*****************************
* 删除
*/
public void deleteEquipment(int equipment_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mEquipment.delete(equipment_id);
}
}

View File

@ -1,47 +1,47 @@
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictFundingMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictFunding;
@Service
public class DictFundingService {
@Autowired
private IDictFundingMapper mFunding;
/***********************
* 增加或者修改
*/
public void editFunding(DictFunding funding) {
HmeFrameAssertHelper.isNotEmpty(funding.getFunding_name(), "资助机构名称不允许为空!");
// 判断类型是否存在
List<DictFunding> list = this.mFunding.listByColumn("funding_name", funding.getFunding_name());
if (funding.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - funding.getTsy_id() != 0)
throw new BusinessException("资助机构名称【" + funding.getFunding_name() + "】已经存在,请检查!");
this.mFunding.update(funding);
} else {
HmeFrameAssertHelper.isEmpty(list, "资助机构名称【" + funding.getFunding_name() + "】已经存在,请检查!");
funding.setCreate_time(LocalDateTime.now());
this.mFunding.insert(funding);
}
}
/*****************************
* 删除
*/
public void deleteFunding(int funding_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mFunding.delete(funding_id);
}
}
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictFundingMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictFunding;
@Service
public class DictFundingService {
@Autowired
private IDictFundingMapper mFunding;
/***********************
* 增加或者修改
*/
public void editFunding(DictFunding funding) {
HmeFrameAssertHelper.isNotEmpty(funding.getFunding_name(), "资助机构名称不允许为空!");
// 判断类型是否存在
List<DictFunding> list = this.mFunding.listByColumn("funding_name", funding.getFunding_name());
if (funding.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - funding.getTsy_id() != 0)
throw new BusinessException("资助机构名称【" + funding.getFunding_name() + "】已经存在,请检查!");
this.mFunding.update(funding);
} else {
HmeFrameAssertHelper.isEmpty(list, "资助机构名称【" + funding.getFunding_name() + "】已经存在,请检查!");
funding.setCreate_time(LocalDateTime.now());
this.mFunding.insert(funding);
}
}
/*****************************
* 删除
*/
public void deleteFunding(int funding_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mFunding.delete(funding_id);
}
}

View File

@ -1,48 +1,48 @@
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictPlatformMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictPlatform;
@Service
public class DictPlatformService {
@Autowired
private IDictPlatformMapper mPlatform;
/***********************
* 增加或者修改
*/
public void editPlatform(DictPlatform platform) {
HmeFrameAssertHelper.isNotEmpty(platform.getPlatform_name(), "平台类型名称不允许为空!");
// 判断类型是否存在
List<DictPlatform> list = this.mPlatform.listByColumn("platform_name", platform.getPlatform_name());
if (platform.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - platform.getTsy_id() != 0)
throw new BusinessException("平台类型名称【" + platform.getPlatform_name() + "】已经存在,请检查!");
// platform.setCreate_time(LocalDateTime.now());
this.mPlatform.update(platform);
} else {
HmeFrameAssertHelper.isEmpty(list, "平台类型名称【" + platform.getPlatform_name() + "】已经存在,请检查!");
platform.setCreate_time(LocalDateTime.now());
this.mPlatform.insert(platform);
}
}
/*****************************
* 删除
*/
public void deletePlatform(int platform_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mPlatform.delete(platform_id);
}
}
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictPlatformMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictPlatform;
@Service
public class DictPlatformService {
@Autowired
private IDictPlatformMapper mPlatform;
/***********************
* 增加或者修改
*/
public void editPlatform(DictPlatform platform) {
HmeFrameAssertHelper.isNotEmpty(platform.getPlatform_name(), "平台类型名称不允许为空!");
// 判断类型是否存在
List<DictPlatform> list = this.mPlatform.listByColumn("platform_name", platform.getPlatform_name());
if (platform.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - platform.getTsy_id() != 0)
throw new BusinessException("平台类型名称【" + platform.getPlatform_name() + "】已经存在,请检查!");
// platform.setCreate_time(LocalDateTime.now());
this.mPlatform.update(platform);
} else {
HmeFrameAssertHelper.isEmpty(list, "平台类型名称【" + platform.getPlatform_name() + "】已经存在,请检查!");
platform.setCreate_time(LocalDateTime.now());
this.mPlatform.insert(platform);
}
}
/*****************************
* 删除
*/
public void deletePlatform(int platform_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mPlatform.delete(platform_id);
}
}

View File

@ -1,47 +1,47 @@
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitSail;
@Service
public class DictUnitSailService {
@Autowired
private IDictUnitSailMapper mUnitSail;
/***********************
* 增加或者修改
*/
public void editUnitSail(DictUnitSail sail) {
HmeFrameAssertHelper.isNotEmpty(sail.getUnit_name(), "参航单位名称不允许为空!");
// 判断类型是否存在
List<DictUnitSail> list = this.mUnitSail.listByColumn("unit_name", sail.getUnit_name());
if (sail.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - sail.getTsy_id() != 0)
throw new BusinessException("参航单位名称【" + sail.getUnit_name() + "】已经存在,请检查!");
this.mUnitSail.update(sail);
} else {
HmeFrameAssertHelper.isEmpty(list, "参航单位名称【" + sail.getUnit_name() + "】已经存在,请检查!");
sail.setCreate_time(LocalDateTime.now());
this.mUnitSail.insert(sail);
}
}
/*****************************
* 删除
*/
public void deleteUnitSail(int sail_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mUnitSail.delete(sail_id);
}
}
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitSail;
@Service
public class DictUnitSailService {
@Autowired
private IDictUnitSailMapper mUnitSail;
/***********************
* 增加或者修改
*/
public void editUnitSail(DictUnitSail sail) {
HmeFrameAssertHelper.isNotEmpty(sail.getUnit_name(), "参航单位名称不允许为空!");
// 判断类型是否存在
List<DictUnitSail> list = this.mUnitSail.listByColumn("unit_name", sail.getUnit_name());
if (sail.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - sail.getTsy_id() != 0)
throw new BusinessException("参航单位名称【" + sail.getUnit_name() + "】已经存在,请检查!");
this.mUnitSail.update(sail);
} else {
HmeFrameAssertHelper.isEmpty(list, "参航单位名称【" + sail.getUnit_name() + "】已经存在,请检查!");
sail.setCreate_time(LocalDateTime.now());
this.mUnitSail.insert(sail);
}
}
/*****************************
* 删除
*/
public void deleteUnitSail(int sail_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mUnitSail.delete(sail_id);
}
}

View File

@ -1,47 +1,47 @@
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitShareMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitShare;
@Service
public class DictUnitShareService {
@Autowired
private IDictUnitShareMapper mUnitShare;
/***********************
* 增加或者修改
*/
public void editUnitShare(DictUnitShare share) {
HmeFrameAssertHelper.isNotEmpty(share.getUnit_name(), "共享单位名称不允许为空!");
// 判断类型是否存在
List<DictUnitShare> list = this.mUnitShare.listByColumn("unit_name", share.getUnit_name());
if (share.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - share.getTsy_id() != 0)
throw new BusinessException("共享单位名称【" + share.getUnit_name() + "】已经存在,请检查!");
this.mUnitShare.update(share);
} else {
HmeFrameAssertHelper.isEmpty(list, "共享单位名称【" + share.getUnit_name() + "】已经存在,请检查!");
share.setCreate_time(LocalDateTime.now());
this.mUnitShare.insert(share);
}
}
/*****************************
* 删除
*/
public void deleteUnitShare(int share_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mUnitShare.delete(share_id);
}
}
package cn.tsy.cas.idsse.dsds.service.dict;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitShareMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitShare;
@Service
public class DictUnitShareService {
@Autowired
private IDictUnitShareMapper mUnitShare;
/***********************
* 增加或者修改
*/
public void editUnitShare(DictUnitShare share) {
HmeFrameAssertHelper.isNotEmpty(share.getUnit_name(), "共享单位名称不允许为空!");
// 判断类型是否存在
List<DictUnitShare> list = this.mUnitShare.listByColumn("unit_name", share.getUnit_name());
if (share.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - share.getTsy_id() != 0)
throw new BusinessException("共享单位名称【" + share.getUnit_name() + "】已经存在,请检查!");
this.mUnitShare.update(share);
} else {
HmeFrameAssertHelper.isEmpty(list, "共享单位名称【" + share.getUnit_name() + "】已经存在,请检查!");
share.setCreate_time(LocalDateTime.now());
this.mUnitShare.insert(share);
}
}
/*****************************
* 删除
*/
public void deleteUnitShare(int share_id) {
/**************
* @todo 需要去判断是否真的可以删除
*/
this.mUnitShare.delete(share_id);
}
}

View File

@ -1,406 +1,406 @@
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.hme.framework.helper.time.HmeTimeHelper.TimeCompareType;
import cn.hme.framework.jdbc.entity.OrderBy;
import cn.hme.framework.jdbc.entity.SqlCondition;
import cn.hme.framework.jdbc.entity.SqlQuery;
import cn.tsy.cas.idsse.dsds.constant.VoyageJobType;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictDataMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictPlatformMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleStationMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictData;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictEquipment;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictPlatform;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDatasetTrack;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStation;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@Service
public class SampleDatasetService {
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private ISampleLineMapper mLine;
@Autowired
private ISampleStationMapper mStation;
@Autowired
private ISampleDatasetTrackMapper mMapper;
@Autowired
private IDictPlatformMapper mPlatform;
@Autowired
private IDictEquipmentMapper mEquipment;
@Autowired
private IDictDataMapper mData;
@Autowired
private IVoyageMemberMapper mMember;
/***********************
* 增加或者修改
*
*/
public SampleDataset editDataset(SampleDataset dataset, Integer old_dataset_id, HmeFrameOptr optr) {
HmeFrameAssertHelper.isNotNull(dataset.getVoyage_id(), "航次号不能为空!");
HmeFrameAssertHelper.isNotNull(dataset.getPlatform_id(), "平台类型不能为空!");
// HmeFrameAssertHelper.isNotEmpty(dataset.getPlatform_name(), "平台名称不能为空!");
HmeFrameAssertHelper.isNotNull(dataset.getEquipment_id(), "设备类型不能为空!");
HmeFrameAssertHelper.isNotNull(dataset.getData_id(), "数据样品类型不能为空!");
HmeFrameAssertHelper.isNotEmpty(dataset.getJob_type(), "作业类型不能为空!");
// TS2-37-1_SY665_JXS_WW_
// 数据样品编号 航次号_潜次号_设备类型_数据样品类型_作业序号
//
VoyageReg voyage = this.mVoyage.find(dataset.getVoyage_id());
HmeFrameAssertHelper.isNotNull(voyage, "未找到指定的航次信息,请检查!");
if (dataset.getWater_in_time() != null && dataset.getWater_out_time() != null) {
dataset.setWater_minutes(HmeLocalDateHelper.calTimeDiff(dataset.getWater_out_time(), dataset.getWater_in_time(), TimeCompareType.Minute).intValue());
}
if (dataset.getBottom_time() != null && dataset.getReceive_time() != null) {
dataset.setJob_minutes(HmeLocalDateHelper.calTimeDiff(dataset.getReceive_time(), dataset.getBottom_time(), TimeCompareType.Minute).intValue());
}
if (dataset.getTsy_id() == null) {
DictPlatform platform = this.mPlatform.find(dataset.getPlatform_id());
DictEquipment equipment = this.mEquipment.find(dataset.getEquipment_id());
DictData data = this.mData.find(dataset.getData_id());
dataset.setCreate_time(LocalDateTime.now());
dataset.setPlatform_type(platform.getPlatform_name());
dataset.setPlatform_alias(platform.getPlatform_alias());
dataset.setEquipment_type(equipment.getEquipment_name());
dataset.setEquipment_alias(equipment.getEquipment_alias());
dataset.setData_alias(data.getData_alias());
dataset.setData_type(data.getData_name());
dataset.setVoyage_name(voyage.getVoyage_name());
// 新增需要生成数据集和数据样品编号
String dataset_name = voyage.getVoyage_name() + "_" + (HmeStringHelper.isEmpty(dataset.getDiving_sn()) ? dataset.getPlatform_alias() : dataset.getDiving_sn()) + "_" + dataset.getEquipment_alias() + "_" + dataset.getData_alias();
// 找到序号
SampleDataset ds = this.mDataset.findByColumn("dataset_name", dataset_name);
if (ds != null) {
return ds;
// throw new BusinessException("数据集["++"]已经存在,无需重复添加!");
}
dataset.setDataset_name(dataset_name);
this.mDataset.insert(dataset);
if (old_dataset_id != null && HmeStringHelper.hasValue(dataset.getDiving_sn())) {
// 如果是从旧数据集复制的
SampleDataset old = this.mDataset.find(old_dataset_id);
if (HmeStringHelper.hasValue(old.getDiving_track_file())) {
// 如果有潜轨迹文件
SampleDataset dd = new SampleDataset();
dd.setTsy_id(dataset.getTsy_id());
dd.setDiving_track_file(old.getDiving_track_file());
this.mDataset.update(dd);
// 轨迹
for (SampleDatasetTrack t : this.mMapper.listByColumnWithOrder("dataset_id", old_dataset_id, OrderBy.of("tsy_id"))) {
t.setDataset_id(dataset.getTsy_id());
t.setTsy_id(null);
this.mMapper.insert(t);
}
}
}
} else {
this.mDataset.update(dataset);
}
return dataset;
}
public List<SampleDataset> uploadSample(List<List<String>> values, HmeFrameOptr optr) {
/****
* *航次名称 *平台类型 *平台名称 *潜次序号 布放经度 布放纬度 布放深度
* 入水时间 出水时间 左舷 右舷 主驾
* 坐底时间 抛载时间 回收时间
* *设备类型 设备序列号
* *作业类型 *样品类型 序号 采样时间 经度 纬度 深度 测线号 深度 开始经度 开始纬度 结束经度 结束纬度 开始时间 结束时间 备注 数据公开期限
*/
HmeFrameAssertHelper.hasValue(values, "导入的文件中无有效数据,请检查!");
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 throwing_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 data_name = list.get(18);
String station_seq = 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 data_status = list.get(32);
String remark = list.get(33);
String data_role = list.get(34);
String fouing_org = list.get(35);
SampleDataset sa = new SampleDataset();
VoyageReg voyage = this.mVoyage.findByColumn("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.findByColumn("platform_name", platform_type);
if (platform == null)
throwError(i, "平台类型[" + platform_type + "]未找到,请先添加该平台类型");
sa.setPlatform_type(platform_type);
sa.setPlatform_name(platform_name);
sa.setPlatform_id(platform.getTsy_id());
sa.setPlatform_alias(platform.getPlatform_alias());
DictEquipment equipment = this.mEquipment.findByColumn("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.findByColumn("data_name", data_name);
if (data == null)
throwError(i, "数据样品类型[" + data_name + "]未找到,请先添加该数据样品类型");
sa.setData_alias(data.getData_alias());
sa.setData_id(data.getTsy_id());
sa.setData_type(data.getData_name());
sa.setJob_type(job_type);
sa.setDiving_sn(diving_name);
sa.setEquipment_sn(equipment_sn);
if (HmeStringHelper.hasValue(wiring_lon))
sa.setWiring_lon(checkValue(wiring_lon));
if (HmeStringHelper.hasValue(wiring_lat))
sa.setWiring_lat(checkValue(wiring_lat));
if (HmeStringHelper.hasValue(wiring_deep))
sa.setWiring_deep(wiring_deep);
if (HmeStringHelper.hasValue(water_in_time))
sa.setWater_in_time(HmeLocalDateHelper.parseDateTime(water_in_time));
if (HmeStringHelper.hasValue(water_out_time))
sa.setWater_out_time(HmeLocalDateHelper.parseDateTime(water_out_time));
if (HmeStringHelper.hasValue(driver_left)) {
sa.setDriver_left(driver_left);
// 获取科学家单位
List<VoyageMember> mArray = this.mMember.list(SqlQuery.create()
.addCondition("voyage_id", voyage.getTsy_id())
.addCondition("member_name", driver_left));
if(mArray.size()>0)
sa.setDriver_unit_left(mArray.get(0).getMember_unit());
}
if (HmeStringHelper.hasValue(driver_right)) {
sa.setDriver_right(driver_right);
List<VoyageMember> mArray = this.mMember.list(SqlQuery.create()
.addCondition("voyage_id", voyage.getTsy_id())
.addCondition("member_name", driver_right));
if(mArray.size()>0)
sa.setDriver_unit_right(mArray.get(0).getMember_unit());
}
if (HmeStringHelper.hasValue(driver_master))
sa.setDriver_master(driver_master);
if (HmeStringHelper.hasValue(bottom_time))
sa.setBottom_time(HmeLocalDateHelper.parseDateTime(bottom_time));
if (HmeStringHelper.hasValue(throwing_time))
sa.setThrowing_time(HmeLocalDateHelper.parseDateTime(throwing_time));
if (HmeStringHelper.hasValue(receive_time))
sa.setReceive_time(HmeLocalDateHelper.parseDateTime(receive_time));
// 新增需要生成数据集和数据样品编号
String dataset_name = voyage.getVoyage_name() + "_" + (HmeStringHelper.isEmpty(diving_name) ? platform.getPlatform_alias() : diving_name) + "_" + equipment.getEquipment_alias() + "_" + data.getData_alias();
sa.setDataset_name(dataset_name);
if (sa.getWater_in_time() != null && sa.getWater_out_time() != null) {
sa.setWater_minutes(HmeLocalDateHelper.calTimeDiff(sa.getWater_out_time(), sa.getWater_in_time(), TimeCompareType.Minute).intValue());
}
if (sa.getBottom_time() != null && sa.getThrowing_time() != null) {
sa.setJob_minutes(HmeLocalDateHelper.calTimeDiff(sa.getThrowing_time(), sa.getBottom_time(), TimeCompareType.Minute).intValue());
}
SampleDataset ds = this.mDataset.findByColumn("dataset_name", dataset_name);
if (ds == null) {
sa.setCreate_time(LocalDateTime.now());
this.mDataset.insert(sa);
} else {
sa.setTsy_id(ds.getTsy_id());
this.mDataset.update(sa);
}
SampleLine line = new SampleLine();
SampleStation st = new SampleStation();
if (HmeStringHelper.isEmpty(job_type))
throwError(i, "作业类型为空,请检查!");
if (VoyageJobType.Line.equals(job_type)) {
if(HmeStringHelper.hasValue(fouing_org))
line.setFunding_org(fouing_org);
if (HmeStringHelper.hasValue(line_sn))
line.setLine_sn(line_sn);
if (HmeStringHelper.hasValue(start_lon))
line.setStart_lon(checkValue(start_lon));
if (HmeStringHelper.hasValue(start_lat))
line.setStart_lat(checkValue(start_lat));
if (HmeStringHelper.hasValue(end_lon))
line.setEnd_lon(checkValue(end_lon));
if (HmeStringHelper.hasValue(end_lat))
line.setEnd_lat(checkValue(end_lat));
if (HmeStringHelper.hasValue(start_time))
line.setStart_time(HmeLocalDateHelper.parseDateTime(start_time));
if (HmeStringHelper.hasValue(end_time))
line.setEnd_time(HmeLocalDateHelper.parseDateTime(end_time));
if(HmeStringHelper.hasValue(data_status))
line.setSample_status(data_status);
line.setDataset_name(dataset_name);
line.setDataset_id(sa.getTsy_id());
if (HmeStringHelper.isEmpty(line_sn)) {
// 找到序号
Integer total = this.mLine.count(SqlCondition.of("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 + HmeStringHelper.leftPad(seq + "", 2, '0');
}
line.setSample_seq(HmeStringHelper.leftPad(seq + "", 2, '0'));
line.setSample_name(sample_code);
} else {
line.setLine_sn(HmeStringHelper.leftPad(line_sn + "", 2, '0'));
line.setSample_seq(HmeStringHelper.leftPad(line_sn + "", 2, '0'));
line.setSample_name(dataset_name + "_" + HmeStringHelper.leftPad(line_sn + "", 2, '0'));
}
if (HmeStringHelper.hasValue(line_deep))
line.setLine_deep(line_deep);
if (HmeStringHelper.hasValue(remark))
line.setSample_remark(remark);
if (HmeStringHelper.hasValue(data_role))
line.setPublish_rule(data_role);
line.setCreate_time(LocalDateTime.now());
// 判断是否存在
if (this.mLine.findByColumn("sample_name", line.getSample_name()) != null) {
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.hme.framework.helper.time.HmeTimeHelper.TimeCompareType;
import cn.hme.framework.jdbc.entity.OrderBy;
import cn.hme.framework.jdbc.entity.SqlCondition;
import cn.hme.framework.jdbc.entity.SqlQuery;
import cn.tsy.cas.idsse.dsds.constant.VoyageJobType;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictDataMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictPlatformMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleStationMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictData;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictEquipment;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictPlatform;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDatasetTrack;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStation;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@Service
public class SampleDatasetService {
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private ISampleLineMapper mLine;
@Autowired
private ISampleStationMapper mStation;
@Autowired
private ISampleDatasetTrackMapper mMapper;
@Autowired
private IDictPlatformMapper mPlatform;
@Autowired
private IDictEquipmentMapper mEquipment;
@Autowired
private IDictDataMapper mData;
@Autowired
private IVoyageMemberMapper mMember;
/***********************
* 增加或者修改
*
*/
public SampleDataset editDataset(SampleDataset dataset, Integer old_dataset_id, HmeFrameOptr optr) {
HmeFrameAssertHelper.isNotNull(dataset.getVoyage_id(), "航次号不能为空!");
HmeFrameAssertHelper.isNotNull(dataset.getPlatform_id(), "平台类型不能为空!");
// HmeFrameAssertHelper.isNotEmpty(dataset.getPlatform_name(), "平台名称不能为空!");
HmeFrameAssertHelper.isNotNull(dataset.getEquipment_id(), "设备类型不能为空!");
HmeFrameAssertHelper.isNotNull(dataset.getData_id(), "数据样品类型不能为空!");
HmeFrameAssertHelper.isNotEmpty(dataset.getJob_type(), "作业类型不能为空!");
// TS2-37-1_SY665_JXS_WW_
// 数据样品编号 航次号_潜次号_设备类型_数据样品类型_作业序号
//
VoyageReg voyage = this.mVoyage.find(dataset.getVoyage_id());
HmeFrameAssertHelper.isNotNull(voyage, "未找到指定的航次信息,请检查!");
if (dataset.getWater_in_time() != null && dataset.getWater_out_time() != null) {
dataset.setWater_minutes(HmeLocalDateHelper.calTimeDiff(dataset.getWater_out_time(), dataset.getWater_in_time(), TimeCompareType.Minute).intValue());
}
if (dataset.getBottom_time() != null && dataset.getReceive_time() != null) {
dataset.setJob_minutes(HmeLocalDateHelper.calTimeDiff(dataset.getReceive_time(), dataset.getBottom_time(), TimeCompareType.Minute).intValue());
}
if (dataset.getTsy_id() == null) {
DictPlatform platform = this.mPlatform.find(dataset.getPlatform_id());
DictEquipment equipment = this.mEquipment.find(dataset.getEquipment_id());
DictData data = this.mData.find(dataset.getData_id());
dataset.setCreate_time(LocalDateTime.now());
dataset.setPlatform_type(platform.getPlatform_name());
dataset.setPlatform_alias(platform.getPlatform_alias());
dataset.setEquipment_type(equipment.getEquipment_name());
dataset.setEquipment_alias(equipment.getEquipment_alias());
dataset.setData_alias(data.getData_alias());
dataset.setData_type(data.getData_name());
dataset.setVoyage_name(voyage.getVoyage_name());
// 新增需要生成数据集和数据样品编号
String dataset_name = voyage.getVoyage_name() + "_" + (HmeStringHelper.isEmpty(dataset.getDiving_sn()) ? dataset.getPlatform_alias() : dataset.getDiving_sn()) + "_" + dataset.getEquipment_alias() + "_" + dataset.getData_alias();
// 找到序号
SampleDataset ds = this.mDataset.findByColumn("dataset_name", dataset_name);
if (ds != null) {
return ds;
// throw new BusinessException("数据集["++"]已经存在,无需重复添加!");
}
dataset.setDataset_name(dataset_name);
this.mDataset.insert(dataset);
if (old_dataset_id != null && HmeStringHelper.hasValue(dataset.getDiving_sn())) {
// 如果是从旧数据集复制的
SampleDataset old = this.mDataset.find(old_dataset_id);
if (HmeStringHelper.hasValue(old.getDiving_track_file())) {
// 如果有潜轨迹文件
SampleDataset dd = new SampleDataset();
dd.setTsy_id(dataset.getTsy_id());
dd.setDiving_track_file(old.getDiving_track_file());
this.mDataset.update(dd);
// 轨迹
for (SampleDatasetTrack t : this.mMapper.listByColumnWithOrder("dataset_id", old_dataset_id, OrderBy.of("tsy_id"))) {
t.setDataset_id(dataset.getTsy_id());
t.setTsy_id(null);
this.mMapper.insert(t);
}
}
}
} else {
this.mDataset.update(dataset);
}
return dataset;
}
public List<SampleDataset> uploadSample(List<List<String>> values, HmeFrameOptr optr) {
/****
* *航次名称 *平台类型 *平台名称 *潜次序号 布放经度 布放纬度 布放深度
* 入水时间 出水时间 左舷 右舷 主驾
* 坐底时间 抛载时间 回收时间
* *设备类型 设备序列号
* *作业类型 *样品类型 序号 采样时间 经度 纬度 深度 测线号 深度 开始经度 开始纬度 结束经度 结束纬度 开始时间 结束时间 备注 数据公开期限
*/
HmeFrameAssertHelper.hasValue(values, "导入的文件中无有效数据,请检查!");
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 throwing_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 data_name = list.get(18);
String station_seq = 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 data_status = list.get(32);
String remark = list.get(33);
String data_role = list.get(34);
String fouing_org = list.get(35);
SampleDataset sa = new SampleDataset();
VoyageReg voyage = this.mVoyage.findByColumn("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.findByColumn("platform_name", platform_type);
if (platform == null)
throwError(i, "平台类型[" + platform_type + "]未找到,请先添加该平台类型");
sa.setPlatform_type(platform_type);
sa.setPlatform_name(platform_name);
sa.setPlatform_id(platform.getTsy_id());
sa.setPlatform_alias(platform.getPlatform_alias());
DictEquipment equipment = this.mEquipment.findByColumn("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.findByColumn("data_name", data_name);
if (data == null)
throwError(i, "数据样品类型[" + data_name + "]未找到,请先添加该数据样品类型");
sa.setData_alias(data.getData_alias());
sa.setData_id(data.getTsy_id());
sa.setData_type(data.getData_name());
sa.setJob_type(job_type);
sa.setDiving_sn(diving_name);
sa.setEquipment_sn(equipment_sn);
if (HmeStringHelper.hasValue(wiring_lon))
sa.setWiring_lon(checkValue(wiring_lon));
if (HmeStringHelper.hasValue(wiring_lat))
sa.setWiring_lat(checkValue(wiring_lat));
if (HmeStringHelper.hasValue(wiring_deep))
sa.setWiring_deep(wiring_deep);
if (HmeStringHelper.hasValue(water_in_time))
sa.setWater_in_time(HmeLocalDateHelper.parseDateTime(water_in_time));
if (HmeStringHelper.hasValue(water_out_time))
sa.setWater_out_time(HmeLocalDateHelper.parseDateTime(water_out_time));
if (HmeStringHelper.hasValue(driver_left)) {
sa.setDriver_left(driver_left);
// 获取科学家单位
List<VoyageMember> mArray = this.mMember.list(SqlQuery.create()
.addCondition("voyage_id", voyage.getTsy_id())
.addCondition("member_name", driver_left));
if(mArray.size()>0)
sa.setDriver_unit_left(mArray.get(0).getMember_unit());
}
if (HmeStringHelper.hasValue(driver_right)) {
sa.setDriver_right(driver_right);
List<VoyageMember> mArray = this.mMember.list(SqlQuery.create()
.addCondition("voyage_id", voyage.getTsy_id())
.addCondition("member_name", driver_right));
if(mArray.size()>0)
sa.setDriver_unit_right(mArray.get(0).getMember_unit());
}
if (HmeStringHelper.hasValue(driver_master))
sa.setDriver_master(driver_master);
if (HmeStringHelper.hasValue(bottom_time))
sa.setBottom_time(HmeLocalDateHelper.parseDateTime(bottom_time));
if (HmeStringHelper.hasValue(throwing_time))
sa.setThrowing_time(HmeLocalDateHelper.parseDateTime(throwing_time));
if (HmeStringHelper.hasValue(receive_time))
sa.setReceive_time(HmeLocalDateHelper.parseDateTime(receive_time));
// 新增需要生成数据集和数据样品编号
String dataset_name = voyage.getVoyage_name() + "_" + (HmeStringHelper.isEmpty(diving_name) ? platform.getPlatform_alias() : diving_name) + "_" + equipment.getEquipment_alias() + "_" + data.getData_alias();
sa.setDataset_name(dataset_name);
if (sa.getWater_in_time() != null && sa.getWater_out_time() != null) {
sa.setWater_minutes(HmeLocalDateHelper.calTimeDiff(sa.getWater_out_time(), sa.getWater_in_time(), TimeCompareType.Minute).intValue());
}
if (sa.getBottom_time() != null && sa.getThrowing_time() != null) {
sa.setJob_minutes(HmeLocalDateHelper.calTimeDiff(sa.getThrowing_time(), sa.getBottom_time(), TimeCompareType.Minute).intValue());
}
SampleDataset ds = this.mDataset.findByColumn("dataset_name", dataset_name);
if (ds == null) {
sa.setCreate_time(LocalDateTime.now());
this.mDataset.insert(sa);
} else {
sa.setTsy_id(ds.getTsy_id());
this.mDataset.update(sa);
}
SampleLine line = new SampleLine();
SampleStation st = new SampleStation();
if (HmeStringHelper.isEmpty(job_type))
throwError(i, "作业类型为空,请检查!");
if (VoyageJobType.Line.equals(job_type)) {
if(HmeStringHelper.hasValue(fouing_org))
line.setFunding_org(fouing_org);
if (HmeStringHelper.hasValue(line_sn))
line.setLine_sn(line_sn);
if (HmeStringHelper.hasValue(start_lon))
line.setStart_lon(checkValue(start_lon));
if (HmeStringHelper.hasValue(start_lat))
line.setStart_lat(checkValue(start_lat));
if (HmeStringHelper.hasValue(end_lon))
line.setEnd_lon(checkValue(end_lon));
if (HmeStringHelper.hasValue(end_lat))
line.setEnd_lat(checkValue(end_lat));
if (HmeStringHelper.hasValue(start_time))
line.setStart_time(HmeLocalDateHelper.parseDateTime(start_time));
if (HmeStringHelper.hasValue(end_time))
line.setEnd_time(HmeLocalDateHelper.parseDateTime(end_time));
if(HmeStringHelper.hasValue(data_status))
line.setSample_status(data_status);
line.setDataset_name(dataset_name);
line.setDataset_id(sa.getTsy_id());
if (HmeStringHelper.isEmpty(line_sn)) {
// 找到序号
Integer total = this.mLine.count(SqlCondition.of("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 + HmeStringHelper.leftPad(seq + "", 2, '0');
}
line.setSample_seq(HmeStringHelper.leftPad(seq + "", 2, '0'));
line.setSample_name(sample_code);
} else {
line.setLine_sn(HmeStringHelper.leftPad(line_sn + "", 2, '0'));
line.setSample_seq(HmeStringHelper.leftPad(line_sn + "", 2, '0'));
line.setSample_name(dataset_name + "_" + HmeStringHelper.leftPad(line_sn + "", 2, '0'));
}
if (HmeStringHelper.hasValue(line_deep))
line.setLine_deep(line_deep);
if (HmeStringHelper.hasValue(remark))
line.setSample_remark(remark);
if (HmeStringHelper.hasValue(data_role))
line.setPublish_rule(data_role);
line.setCreate_time(LocalDateTime.now());
// 判断是否存在
if (this.mLine.findByColumn("sample_name", line.getSample_name()) != null) {
this.mLine.deleteByColumn("sample_name", line.getSample_name());
// throwError(i, "测线作业[" + st.getSample_name() + "]已经存在!");
}
this.mLine.insert(line);
} else if (VoyageJobType.Station.equals(job_type)) {
if(HmeStringHelper.hasValue(fouing_org))
st.setFunding_org(fouing_org);
if (HmeStringHelper.hasValue(sampling_time))
st.setSampling_time(HmeLocalDateHelper.parseDateTime(sampling_time));
if (HmeStringHelper.hasValue(sampling_lat))
st.setSampling_lat(checkValue(sampling_lat));
if (HmeStringHelper.hasValue(sampling_lon))
st.setSampling_lon(checkValue(sampling_lon));
if (HmeStringHelper.hasValue(sampling_deep))
st.setSampling_deep(sampling_deep);
if (HmeStringHelper.isEmpty(station_seq)) {
// 找到序号
Integer total = this.mStation.count(SqlCondition.of("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 + HmeStringHelper.leftPad(seq + "", 2, '0');
}
st.setSample_seq(HmeStringHelper.leftPad(seq + "", 2, '0'));
st.setSample_name(sample_code);
} else {
st.setSample_seq(HmeStringHelper.leftPad(station_seq + "", 2, '0'));
st.setSample_name(dataset_name + "_" + HmeStringHelper.leftPad(station_seq + "", 2, '0'));
}
if (HmeStringHelper.hasValue(remark))
st.setSample_remark(remark);
if (HmeStringHelper.hasValue(data_role))
st.setPublish_rule(data_role);
// 判断是否存在
if (this.mStation.findByColumn("sample_name", st.getSample_name()) != null) {
// throwError(i, "站位作业[" + st.getSample_name() + "]已经存在!");
this.mStation.deleteByColumn("sample_name", st.getSample_name());
}
st.setCreate_time(LocalDateTime.now());
st.setDataset_name(dataset_name);
st.setDataset_id(sa.getTsy_id());
this.mStation.insert(st);
} else
throwError(i, "作业类型[" + job_type + "]必须为测线作业或者站位作业!");
}
return new ArrayList<>();
}
/****************
* 删除数据样品
*
*/
public void deleteDataset(int dataset_id) {
/****************
* @todo 判断是否能实际删除
*/
this.mDataset.delete(dataset_id);
}
public void throwError(int row, String msg) {
throw new BusinessException("数据样品信息导入失败->第[" + (row + 1) + "]行:" + msg);
}
// 经纬度保留4位
public String checkValue(String value) {
try {
return String.format("%.4f", Double.parseDouble(value));
} catch (Exception e) {
return value;
}
}
}
// throwError(i, "测线作业[" + st.getSample_name() + "]已经存在!");
}
this.mLine.insert(line);
} else if (VoyageJobType.Station.equals(job_type)) {
if(HmeStringHelper.hasValue(fouing_org))
st.setFunding_org(fouing_org);
if (HmeStringHelper.hasValue(sampling_time))
st.setSampling_time(HmeLocalDateHelper.parseDateTime(sampling_time));
if (HmeStringHelper.hasValue(sampling_lat))
st.setSampling_lat(checkValue(sampling_lat));
if (HmeStringHelper.hasValue(sampling_lon))
st.setSampling_lon(checkValue(sampling_lon));
if (HmeStringHelper.hasValue(sampling_deep))
st.setSampling_deep(sampling_deep);
if (HmeStringHelper.isEmpty(station_seq)) {
// 找到序号
Integer total = this.mStation.count(SqlCondition.of("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 + HmeStringHelper.leftPad(seq + "", 2, '0');
}
st.setSample_seq(HmeStringHelper.leftPad(seq + "", 2, '0'));
st.setSample_name(sample_code);
} else {
st.setSample_seq(HmeStringHelper.leftPad(station_seq + "", 2, '0'));
st.setSample_name(dataset_name + "_" + HmeStringHelper.leftPad(station_seq + "", 2, '0'));
}
if (HmeStringHelper.hasValue(remark))
st.setSample_remark(remark);
if (HmeStringHelper.hasValue(data_role))
st.setPublish_rule(data_role);
// 判断是否存在
if (this.mStation.findByColumn("sample_name", st.getSample_name()) != null) {
// throwError(i, "站位作业[" + st.getSample_name() + "]已经存在!");
this.mStation.deleteByColumn("sample_name", st.getSample_name());
}
st.setCreate_time(LocalDateTime.now());
st.setDataset_name(dataset_name);
st.setDataset_id(sa.getTsy_id());
this.mStation.insert(st);
} else
throwError(i, "作业类型[" + job_type + "]必须为测线作业或者站位作业!");
}
return new ArrayList<>();
}
/****************
* 删除数据样品
*
*/
public void deleteDataset(int dataset_id) {
/****************
* @todo 判断是否能实际删除
*/
this.mDataset.delete(dataset_id);
}
public void throwError(int row, String msg) {
throw new BusinessException("数据样品信息导入失败->第[" + (row + 1) + "]行:" + msg);
}
// 经纬度保留4位
public String checkValue(String value) {
try {
return String.format("%.4f", Double.parseDouble(value));
} catch (Exception e) {
return value;
}
}
}

View File

@ -1,111 +1,111 @@
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictGeomMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDatasetTrack;
@Service
public class SampleDatasetTrackService {
@Autowired
private ISampleDatasetTrackMapper mTrack;
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private IDictGeomMapper iGeom;
public List<SampleDatasetTrack> uploadTrack(int dataset_id, List<String> array, String file_name, HmeFrameOptr optr) {
HmeFrameAssertHelper.hasValue(array, "潜次轨迹文件为空,请检查!");
List<SampleDatasetTrack> navArray = new ArrayList<>();
String dv_sn = file_name.replace(".txt", "");
List<SampleDataset> sdArray = this.mDataset.listByColumn("diving_sn", dv_sn);
if (sdArray.size() == 0)
throw new BusinessException("未找到潜次[" + dv_sn + "]对应的数据集!");
// SampleDataset dataset = this.mDataset.find(dataset_id);
// HmeFrameAssertHelper.isNotNull(dataset, "未找到指定数据集,请检查!");
// this.mTrack.deleteByColumn("dataset_id", dataset_id);
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0)
break;
String[] values = HmeStringHelper.splitWithSpace(array.get(i));
if (values.length < 3) {
throwError(i, "列不足至少需要3列");
}
String lon = values[0];
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
// try {
// double d = Double.parseDouble(lon);
// if (d > 180)
// throwError(i, "经度[" + lon + "]不能大于 180°");
// if (d < 0)
// throwError(i, "经度[" + lon + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "经度[" + lon + "]格式错误");
// }
// try {
// double d = Double.parseDouble(lat);
// if (d > 90)
// throwError(i, "纬度[" + lat + "]不能大于 90°");
// if (d < 0)
// throwError(i, "纬度[" + lat + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "纬度[" + lat + "]格式错误");
// }
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = HmeLocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3].replace(".000", ""));
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
SampleDatasetTrack nav = new SampleDatasetTrack();
nav.setTrack_lat(lat);
nav.setTrack_lon(lon);
nav.setTrack_time(curTime);
navArray.add(nav);
}
if (navArray.size() > 0) {
for(SampleDataset ds :sdArray) {
this.mTrack.deleteByColumn("dataset_id", ds.getTsy_id());
for(SampleDatasetTrack nav :navArray) {
nav.setTsy_id(null);
nav.setDataset_id(ds.getTsy_id());
this.mTrack.insert(nav);
}
SampleDataset d = new SampleDataset();
d.setTsy_id(dataset_id);
d.setDiving_track_file(file_name);
this.mDataset.update(ds);
}
// 写入图层
this.iGeom.createDiving(dv_sn);
}
return navArray;
}
public void throwError(int row, String msg) {
throw new BusinessException("潜次轨迹文件导入失败->第[" + (row + 1) + "]行:" + msg);
}
}
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictGeomMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDatasetTrack;
@Service
public class SampleDatasetTrackService {
@Autowired
private ISampleDatasetTrackMapper mTrack;
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private IDictGeomMapper iGeom;
public List<SampleDatasetTrack> uploadTrack(int dataset_id, List<String> array, String file_name, HmeFrameOptr optr) {
HmeFrameAssertHelper.hasValue(array, "潜次轨迹文件为空,请检查!");
List<SampleDatasetTrack> navArray = new ArrayList<>();
String dv_sn = file_name.replace(".txt", "");
List<SampleDataset> sdArray = this.mDataset.listByColumn("diving_sn", dv_sn);
if (sdArray.size() == 0)
throw new BusinessException("未找到潜次[" + dv_sn + "]对应的数据集!");
// SampleDataset dataset = this.mDataset.find(dataset_id);
// HmeFrameAssertHelper.isNotNull(dataset, "未找到指定数据集,请检查!");
// this.mTrack.deleteByColumn("dataset_id", dataset_id);
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0)
break;
String[] values = HmeStringHelper.splitWithSpace(array.get(i));
if (values.length < 3) {
throwError(i, "列不足至少需要3列");
}
String lon = values[0];
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
// try {
// double d = Double.parseDouble(lon);
// if (d > 180)
// throwError(i, "经度[" + lon + "]不能大于 180°");
// if (d < 0)
// throwError(i, "经度[" + lon + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "经度[" + lon + "]格式错误");
// }
// try {
// double d = Double.parseDouble(lat);
// if (d > 90)
// throwError(i, "纬度[" + lat + "]不能大于 90°");
// if (d < 0)
// throwError(i, "纬度[" + lat + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "纬度[" + lat + "]格式错误");
// }
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = HmeLocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3].replace(".000", ""));
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
SampleDatasetTrack nav = new SampleDatasetTrack();
nav.setTrack_lat(lat);
nav.setTrack_lon(lon);
nav.setTrack_time(curTime);
navArray.add(nav);
}
if (navArray.size() > 0) {
for(SampleDataset ds :sdArray) {
this.mTrack.deleteByColumn("dataset_id", ds.getTsy_id());
for(SampleDatasetTrack nav :navArray) {
nav.setTsy_id(null);
nav.setDataset_id(ds.getTsy_id());
this.mTrack.insert(nav);
}
SampleDataset d = new SampleDataset();
d.setTsy_id(dataset_id);
d.setDiving_track_file(file_name);
this.mDataset.update(ds);
}
// 写入图层
this.iGeom.createDiving(dv_sn);
}
return navArray;
}
public void throwError(int row, String msg) {
throw new BusinessException("潜次轨迹文件导入失败->第[" + (row + 1) + "]行:" + msg);
}
}

View File

@ -1,85 +1,85 @@
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.helper.lang.HmeGsonHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.SqlCondition;
import cn.hme.industry.gnss.GnssCoordinateHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
@Service
public class SampleLineService {
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private ISampleLineMapper mLine;
/***********************
* 增加或者修改
*
*/
public SampleLine editLine(int dataset_id, SampleLine line, HmeFrameOptr optr) {
SampleDataset dataset = this.mDataset.find(dataset_id);
//
if (line.getTsy_id() == null) {
// 计算序号
Integer total = this.mLine.count(SqlCondition.of("dataset_id", dataset_id));
String seq = "01";
if (total != null && total > 0)
seq = HmeStringHelper.leftPad((total + 1) + "", 2, '0');
line.setDataset_id(dataset_id);
line.setDataset_name(dataset.getDataset_name());
line.setSample_seq(seq);
line.setSample_name(dataset.getDataset_name() + "_" + seq);
line.setCreate_time(LocalDateTime.now());
}
System.out.println(HmeGsonHelper.fromObject(line));
// 计算覆盖面积
if (line.getConver_width() == null)
line.setConver_area(0);
else {
if(HmeStringHelper.hasValue(line.getStart_lat()) && HmeStringHelper.hasValue(line.getEnd_lat())
&& HmeStringHelper.hasValue(line.getStart_lon()) && HmeStringHelper.hasValue(line.getEnd_lon())) {
try {
Double value = GnssCoordinateHelper.distanceHaversine(
Double.parseDouble(line.getStart_lat()) ,
Double.parseDouble(line.getStart_lon()) ,
Double.parseDouble(line.getEnd_lat()) ,
Double.parseDouble(line.getEnd_lon()) ) * line.getConver_width();
line.setConver_area(value.intValue());
}catch(Exception e) {
e.printStackTrace();
line.setConver_area(0);
}
}
}
if (line.getTsy_id() == null)
this.mLine.insert(line);
else
this.mLine.update(line);
return line;
}
/****************
* 删除数据样品
*
*/
public void deleteLine(int line_id) {
/****************
* @todo 判断是否能实际删除
*/
this.mLine.delete(line_id);
}
}
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.helper.lang.HmeGsonHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.SqlCondition;
import cn.hme.industry.gnss.GnssCoordinateHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
@Service
public class SampleLineService {
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private ISampleLineMapper mLine;
/***********************
* 增加或者修改
*
*/
public SampleLine editLine(int dataset_id, SampleLine line, HmeFrameOptr optr) {
SampleDataset dataset = this.mDataset.find(dataset_id);
//
if (line.getTsy_id() == null) {
// 计算序号
Integer total = this.mLine.count(SqlCondition.of("dataset_id", dataset_id));
String seq = "01";
if (total != null && total > 0)
seq = HmeStringHelper.leftPad((total + 1) + "", 2, '0');
line.setDataset_id(dataset_id);
line.setDataset_name(dataset.getDataset_name());
line.setSample_seq(seq);
line.setSample_name(dataset.getDataset_name() + "_" + seq);
line.setCreate_time(LocalDateTime.now());
}
System.out.println(HmeGsonHelper.fromObject(line));
// 计算覆盖面积
if (line.getConver_width() == null)
line.setConver_area(0);
else {
if(HmeStringHelper.hasValue(line.getStart_lat()) && HmeStringHelper.hasValue(line.getEnd_lat())
&& HmeStringHelper.hasValue(line.getStart_lon()) && HmeStringHelper.hasValue(line.getEnd_lon())) {
try {
Double value = GnssCoordinateHelper.distanceHaversine(
Double.parseDouble(line.getStart_lat()) ,
Double.parseDouble(line.getStart_lon()) ,
Double.parseDouble(line.getEnd_lat()) ,
Double.parseDouble(line.getEnd_lon()) ) * line.getConver_width();
line.setConver_area(value.intValue());
}catch(Exception e) {
e.printStackTrace();
line.setConver_area(0);
}
}
}
if (line.getTsy_id() == null)
this.mLine.insert(line);
else
this.mLine.update(line);
return line;
}
/****************
* 删除数据样品
*
*/
public void deleteLine(int line_id) {
/****************
* @todo 判断是否能实际删除
*/
this.mLine.delete(line_id);
}
}

View File

@ -1,220 +1,220 @@
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.log.HmeLogHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.hme.framework.jdbc.entity.SqlQuery;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineTrackMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLineTrack;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@Service
public class SampleLineTrackService {
@Autowired
private ISampleLineTrackMapper mTrack;
@Autowired
private ISampleLineMapper mLine;
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private ISampleDatasetMapper mDataset;
public List<SampleLineTrack> uploadTrack(int dataset_id, List<String> array, String file_name) {
HmeFrameAssertHelper.hasValue(array, "测线轨迹文件为空,请检查!");
if (file_name.toLowerCase().endsWith("m.txt")) {
SampleDataset ds = this.mDataset.find(dataset_id);
if (ds == null) {
throw new BusinessException("未找到对应的数据集信息!");
}
VoyageReg voyage = this.mVoyage.find(ds.getVoyage_id());
String heigth = file_name.replace(".txt", "").replaceAll("m", "").split("_")[1];
// 判断是否已经输入了
this.mLine.deleteByColumn("dataset_id", dataset_id);
int index = 1;
SampleLine line = new SampleLine();
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0) {
break;
}
String[] values = HmeStringHelper.splitWithSpace(array.get(i));
if (values[0].equals(">>")) {
this.createLine(voyage,ds, line, heigth, index);
line = new SampleLine();
HmeLogHelper.info("dataset_index:"+index);
index++;
continue;
}
String lon = values[0];
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
try {
double d = Double.parseDouble(lon);
if (d > 180)
throwError(i, "经度[" + lon + "]不能大于 180°");
if (d < 0)
throwError(i, "经度[" + lon + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "经度[" + lon + "]格式错误");
}
try {
double d = Double.parseDouble(lat);
if (d > 90)
throwError(i, "纬度[" + lat + "]不能大于 90°");
if (d < 0)
throwError(i, "纬度[" + lat + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "纬度[" + lat + "]格式错误");
}
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = HmeLocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3]);
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
if (values.length < 3) {
throwError(i, "列不足至少需要3列");
}
if (line.getStart_lat() == null)
line.setStart_lat(lat);
if (line.getStart_lon() == null)
line.setStart_lon(lon);
if (line.getStart_time() == null)
line.setStart_time(curTime);
line.setEnd_lat(lat);
line.setEnd_lon(lon);
line.setEnd_time(curTime);
}
this.createLine(voyage,ds, line, heigth, index);
} else {
// 找出所有航线
String dv_sn = file_name.replace(".txt", "").replace("_Clean", "");
List<SampleDataset> sdArray = this.mDataset.listByColumn("diving_sn", dv_sn);
if (sdArray.size() == 0) {
throw new BusinessException("未找到潜次[" + dv_sn + "]对应的数据集!");
} else {
for (SampleDataset ds : sdArray) {
int index = 1;
List<SampleLineTrack> navArray = new ArrayList<>();
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0) {
this.update(file_name, ds, index, navArray);
break;
}
String[] values = HmeStringHelper.splitWithSpace(array.get(i));
if (values[0].equals(">>")) {
this.update(file_name, ds, index, navArray);
navArray = new ArrayList<>();
index++;
continue;
}
if (values.length < 3) {
throwError(i, "列不足至少需要3列");
}
// 110.565232 17.370000 2023-05-20-13:55:27
String lon = values[0];
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
try {
double d = Double.parseDouble(lon);
if (d > 180)
throwError(i, "经度[" + lon + "]不能大于 180°");
if (d < 0)
throwError(i, "经度[" + lon + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "经度[" + lon + "]格式错误");
}
try {
double d = Double.parseDouble(lat);
if (d > 90)
throwError(i, "纬度[" + lat + "]不能大于 90°");
if (d < 0)
throwError(i, "纬度[" + lat + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "纬度[" + lat + "]格式错误");
}
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = HmeLocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3]);
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
SampleLineTrack nav = new SampleLineTrack();
nav.setTrack_lat(lat);
nav.setTrack_lon(lon);
nav.setTrack_time(curTime);
navArray.add(nav);
}
}
}
}
return new ArrayList<>();
}
public void createLine(VoyageReg voyage,SampleDataset ds, SampleLine line, String heigth, int index) {
line.setCreate_time(LocalDateTime.now());
line.setDataset_id(ds.getTsy_id());
line.setFunding_org(voyage.getFunding_org());
line.setDataset_name(ds.getDataset_name());
line.setLine_deep(heigth);
line.setPublish_rule("不公开");
line.setSample_status("原始数据");
line.setSample_seq(HmeStringHelper.leftPad(index + "", 2, '0'));
line.setLine_sn(line.getSample_seq());
line.setSample_name(ds.getDataset_name() + "_" + line.getSample_seq());
this.mLine.insert(line);
}
public void update(String file_name, SampleDataset ds, int index, List<SampleLineTrack> navArray) {
if (navArray.size() == 0)
return;
// 查找是否有对应的测线
String sn = HmeStringHelper.leftPad(index + "", 2, '0');
List<SampleLine> lineArray = this.mLine.list(SqlQuery.create().addCondition("dataset_id", ds.getTsy_id()).addCondition("sample_seq", sn));
if (lineArray.size() > 0) {
for (SampleLineTrack nav : navArray) {
nav.setDataset_id(ds.getTsy_id());
nav.setTrack_index(sn);
nav.setLine_id(lineArray.get(0).getTsy_id());
this.mTrack.insert(nav);
}
SampleLine line = new SampleLine();
line.setTsy_id(lineArray.get(0).getTsy_id());
line.setTrack_file_name(file_name);
this.mLine.update(line);
}
navArray = new ArrayList<>();
}
public void throwError(int row, String msg) {
throw new BusinessException("测线轨迹文件导入失败->第[" + (row + 1) + "]行:" + msg);
}
}
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.log.HmeLogHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.hme.framework.jdbc.entity.SqlQuery;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineTrackMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLineTrack;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@Service
public class SampleLineTrackService {
@Autowired
private ISampleLineTrackMapper mTrack;
@Autowired
private ISampleLineMapper mLine;
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private ISampleDatasetMapper mDataset;
public List<SampleLineTrack> uploadTrack(int dataset_id, List<String> array, String file_name) {
HmeFrameAssertHelper.hasValue(array, "测线轨迹文件为空,请检查!");
if (file_name.toLowerCase().endsWith("m.txt")) {
SampleDataset ds = this.mDataset.find(dataset_id);
if (ds == null) {
throw new BusinessException("未找到对应的数据集信息!");
}
VoyageReg voyage = this.mVoyage.find(ds.getVoyage_id());
String heigth = file_name.replace(".txt", "").replaceAll("m", "").split("_")[1];
// 判断是否已经输入了
this.mLine.deleteByColumn("dataset_id", dataset_id);
int index = 1;
SampleLine line = new SampleLine();
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0) {
break;
}
String[] values = HmeStringHelper.splitWithSpace(array.get(i));
if (values[0].equals(">>")) {
this.createLine(voyage,ds, line, heigth, index);
line = new SampleLine();
HmeLogHelper.info("dataset_index:"+index);
index++;
continue;
}
String lon = values[0];
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
try {
double d = Double.parseDouble(lon);
if (d > 180)
throwError(i, "经度[" + lon + "]不能大于 180°");
if (d < 0)
throwError(i, "经度[" + lon + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "经度[" + lon + "]格式错误");
}
try {
double d = Double.parseDouble(lat);
if (d > 90)
throwError(i, "纬度[" + lat + "]不能大于 90°");
if (d < 0)
throwError(i, "纬度[" + lat + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "纬度[" + lat + "]格式错误");
}
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = HmeLocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3]);
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
if (values.length < 3) {
throwError(i, "列不足至少需要3列");
}
if (line.getStart_lat() == null)
line.setStart_lat(lat);
if (line.getStart_lon() == null)
line.setStart_lon(lon);
if (line.getStart_time() == null)
line.setStart_time(curTime);
line.setEnd_lat(lat);
line.setEnd_lon(lon);
line.setEnd_time(curTime);
}
this.createLine(voyage,ds, line, heigth, index);
} else {
// 找出所有航线
String dv_sn = file_name.replace(".txt", "").replace("_Clean", "");
List<SampleDataset> sdArray = this.mDataset.listByColumn("diving_sn", dv_sn);
if (sdArray.size() == 0) {
throw new BusinessException("未找到潜次[" + dv_sn + "]对应的数据集!");
} else {
for (SampleDataset ds : sdArray) {
int index = 1;
List<SampleLineTrack> navArray = new ArrayList<>();
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0) {
this.update(file_name, ds, index, navArray);
break;
}
String[] values = HmeStringHelper.splitWithSpace(array.get(i));
if (values[0].equals(">>")) {
this.update(file_name, ds, index, navArray);
navArray = new ArrayList<>();
index++;
continue;
}
if (values.length < 3) {
throwError(i, "列不足至少需要3列");
}
// 110.565232 17.370000 2023-05-20-13:55:27
String lon = values[0];
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
try {
double d = Double.parseDouble(lon);
if (d > 180)
throwError(i, "经度[" + lon + "]不能大于 180°");
if (d < 0)
throwError(i, "经度[" + lon + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "经度[" + lon + "]格式错误");
}
try {
double d = Double.parseDouble(lat);
if (d > 90)
throwError(i, "纬度[" + lat + "]不能大于 90°");
if (d < 0)
throwError(i, "纬度[" + lat + "]不能小于 0°");
} catch (Exception e) {
throwError(i, "纬度[" + lat + "]格式错误");
}
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = HmeLocalDateHelper.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3]);
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
SampleLineTrack nav = new SampleLineTrack();
nav.setTrack_lat(lat);
nav.setTrack_lon(lon);
nav.setTrack_time(curTime);
navArray.add(nav);
}
}
}
}
return new ArrayList<>();
}
public void createLine(VoyageReg voyage,SampleDataset ds, SampleLine line, String heigth, int index) {
line.setCreate_time(LocalDateTime.now());
line.setDataset_id(ds.getTsy_id());
line.setFunding_org(voyage.getFunding_org());
line.setDataset_name(ds.getDataset_name());
line.setLine_deep(heigth);
line.setPublish_rule("不公开");
line.setSample_status("原始数据");
line.setSample_seq(HmeStringHelper.leftPad(index + "", 2, '0'));
line.setLine_sn(line.getSample_seq());
line.setSample_name(ds.getDataset_name() + "_" + line.getSample_seq());
this.mLine.insert(line);
}
public void update(String file_name, SampleDataset ds, int index, List<SampleLineTrack> navArray) {
if (navArray.size() == 0)
return;
// 查找是否有对应的测线
String sn = HmeStringHelper.leftPad(index + "", 2, '0');
List<SampleLine> lineArray = this.mLine.list(SqlQuery.create().addCondition("dataset_id", ds.getTsy_id()).addCondition("sample_seq", sn));
if (lineArray.size() > 0) {
for (SampleLineTrack nav : navArray) {
nav.setDataset_id(ds.getTsy_id());
nav.setTrack_index(sn);
nav.setLine_id(lineArray.get(0).getTsy_id());
this.mTrack.insert(nav);
}
SampleLine line = new SampleLine();
line.setTsy_id(lineArray.get(0).getTsy_id());
line.setTrack_file_name(file_name);
this.mLine.update(line);
}
navArray = new ArrayList<>();
}
public void throwError(int row, String msg) {
throw new BusinessException("测线轨迹文件导入失败->第[" + (row + 1) + "]行:" + msg);
}
}

View File

@ -1,59 +1,59 @@
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.SqlCondition;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleStationMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStation;
@Service
public class SampleStationService {
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private ISampleStationMapper mStation;
/***********************
* 增加或者修改
*
*/
public SampleStation editStation(int dataset_id, SampleStation satation, HmeFrameOptr optr) {
SampleDataset dataset = this.mDataset.find(dataset_id);
if (satation.getTsy_id() == null) {
// 计算序号
Integer total = this.mStation.count(SqlCondition.of("dataset_id", dataset_id));
String seq = "01";
if (total != null && total > 0)
seq = HmeStringHelper.leftPad((total + 1)+"", 2, '0');
satation.setDataset_id(dataset_id);
satation.setDataset_name(dataset.getDataset_name());
satation.setSample_seq(seq);
satation.setSample_name(dataset.getDataset_name()+"_"+seq);
satation.setCreate_time(LocalDateTime.now());
this.mStation.insert(satation);
}else
this.mStation.update(satation);
return satation;
}
/****************
* 删除数据样品
*
*/
public void deleteStation(int satation_id) {
/****************
* @todo 判断是否能实际删除
*/
this.mStation.delete(satation_id);
}
}
package cn.tsy.cas.idsse.dsds.service.sample;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.jdbc.entity.SqlCondition;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleStationMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStation;
@Service
public class SampleStationService {
@Autowired
private ISampleDatasetMapper mDataset;
@Autowired
private ISampleStationMapper mStation;
/***********************
* 增加或者修改
*
*/
public SampleStation editStation(int dataset_id, SampleStation satation, HmeFrameOptr optr) {
SampleDataset dataset = this.mDataset.find(dataset_id);
if (satation.getTsy_id() == null) {
// 计算序号
Integer total = this.mStation.count(SqlCondition.of("dataset_id", dataset_id));
String seq = "01";
if (total != null && total > 0)
seq = HmeStringHelper.leftPad((total + 1)+"", 2, '0');
satation.setDataset_id(dataset_id);
satation.setDataset_name(dataset.getDataset_name());
satation.setSample_seq(seq);
satation.setSample_name(dataset.getDataset_name()+"_"+seq);
satation.setCreate_time(LocalDateTime.now());
this.mStation.insert(satation);
}else
this.mStation.update(satation);
return satation;
}
/****************
* 删除数据样品
*
*/
public void deleteStation(int satation_id) {
/****************
* @todo 判断是否能实际删除
*/
this.mStation.delete(satation_id);
}
}

View File

@ -1,102 +1,102 @@
package cn.tsy.cas.idsse.dsds.service.voyage;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.tsy.cas.idsse.dsds.constant.VoyageLogType;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageLogMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitSail;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
@Service
public class VoyageMemberService {
@Autowired
private IVoyageMemberMapper mMember;
@Autowired
private IDictUnitSailMapper iUnit;
@Autowired
private IVoyageLogMapper mLog;
public List<VoyageMember> uploadMember(int voyage_id, List<List<String>> values, HmeFrameOptr optr) {
HmeFrameAssertHelper.hasValue(values, "参航人员数量为空,请检查!");
LocalDate startDate = HmeLocalDateHelper.parseDate("1900-01-01");
this.mMember.deleteByColumn("voyage_id", voyage_id);
List<VoyageMember> memberArray = new ArrayList<>();
for (int i = 0; i < values.size(); i++) {
List<String> list = values.get(i);
if (list.get(0) == null || list.get(0).trim().length() == 0)
break;
VoyageMember m = new VoyageMember();
m.setMember_name(list.get(0));
m.setMember_sex(list.get(1));
String date= list.get(2);
if(date!=null) {
// 判断是不是日期
try {
//System.out.println(HmeLocalDateHelper.format(startDate.plusDays(Integer.parseInt(date))));
m.setMember_birthday(HmeLocalDateHelper.format(startDate.plusDays(Integer.parseInt(date))));
}catch(Exception e) {
}
if(m.getMember_birthday()==null)
m.setMember_birthday(date);
}
m.setMember_unit(list.get(3));
m.setMember_dept(list.get(4));
// m.setShip_room_addr(list.get(5));
// m.setMember_tel(list.get(6));
// m.setMember_cert(list.get(7));
// m.setBank_name(list.get(8));
// m.setBank_card(list.get(9));
// m.setBank_addr(list.get(10));
m.setMember_remark(list.get(5));
m.setVoyage_id(voyage_id);
this.mMember.insert(m);
// 判断是否需要增加参航单位
if(HmeStringHelper.hasValue(m.getMember_unit())) {
if(this.iUnit.listByColumn("unit_name", m.getMember_unit()).size()>0) {
DictUnitSail unit = new DictUnitSail();
unit.setUnit_name(m.getMember_unit());
unit.setCreate_time(LocalDateTime.now());
this.iUnit.insert(m);
}
}
memberArray.add(m);
}
if (memberArray.size() > 0)
VoyageRegService.logVoyage(mLog, voyage_id, optr, VoyageLogType.UploadMember, "成功导入[" + memberArray.size() + "]条参航人员");
return memberArray;
}
public void throwError(int row, String msg) {
throw new BusinessException("航次参航人员导入失败->第[" + (row + 1) + "]行:" + msg);
}
public void editMember(VoyageMember member) {
if(member.getTsy_id()==null)
this.mMember.insert(member);
else this.mMember.update(member);
}
public void deleteMember(int member_id) {
this.mMember.delete(member_id);
}
}
package cn.tsy.cas.idsse.dsds.service.voyage;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.tsy.cas.idsse.dsds.constant.VoyageLogType;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageLogMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageMemberMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitSail;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
@Service
public class VoyageMemberService {
@Autowired
private IVoyageMemberMapper mMember;
@Autowired
private IDictUnitSailMapper iUnit;
@Autowired
private IVoyageLogMapper mLog;
public List<VoyageMember> uploadMember(int voyage_id, List<List<String>> values, HmeFrameOptr optr) {
HmeFrameAssertHelper.hasValue(values, "参航人员数量为空,请检查!");
LocalDate startDate = HmeLocalDateHelper.parseDate("1900-01-01");
this.mMember.deleteByColumn("voyage_id", voyage_id);
List<VoyageMember> memberArray = new ArrayList<>();
for (int i = 0; i < values.size(); i++) {
List<String> list = values.get(i);
if (list.get(0) == null || list.get(0).trim().length() == 0)
break;
VoyageMember m = new VoyageMember();
m.setMember_name(list.get(0));
m.setMember_sex(list.get(1));
String date= list.get(2);
if(date!=null) {
// 判断是不是日期
try {
//System.out.println(HmeLocalDateHelper.format(startDate.plusDays(Integer.parseInt(date))));
m.setMember_birthday(HmeLocalDateHelper.format(startDate.plusDays(Integer.parseInt(date))));
}catch(Exception e) {
}
if(m.getMember_birthday()==null)
m.setMember_birthday(date);
}
m.setMember_unit(list.get(3));
m.setMember_dept(list.get(4));
// m.setShip_room_addr(list.get(5));
// m.setMember_tel(list.get(6));
// m.setMember_cert(list.get(7));
// m.setBank_name(list.get(8));
// m.setBank_card(list.get(9));
// m.setBank_addr(list.get(10));
m.setMember_remark(list.get(5));
m.setVoyage_id(voyage_id);
this.mMember.insert(m);
// 判断是否需要增加参航单位
if(HmeStringHelper.hasValue(m.getMember_unit())) {
if(this.iUnit.listByColumn("unit_name", m.getMember_unit()).size()>0) {
DictUnitSail unit = new DictUnitSail();
unit.setUnit_name(m.getMember_unit());
unit.setCreate_time(LocalDateTime.now());
this.iUnit.insert(m);
}
}
memberArray.add(m);
}
if (memberArray.size() > 0)
VoyageRegService.logVoyage(mLog, voyage_id, optr, VoyageLogType.UploadMember, "成功导入[" + memberArray.size() + "]条参航人员");
return memberArray;
}
public void throwError(int row, String msg) {
throw new BusinessException("航次参航人员导入失败->第[" + (row + 1) + "]行:" + msg);
}
public void editMember(VoyageMember member) {
if(member.getTsy_id()==null)
this.mMember.insert(member);
else this.mMember.update(member);
}
public void deleteMember(int member_id) {
this.mMember.delete(member_id);
}
}

View File

@ -1,115 +1,115 @@
package cn.tsy.cas.idsse.dsds.service.voyage;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.tsy.cas.idsse.dsds.constant.VoyageLogType;
import cn.tsy.cas.idsse.dsds.helper.DSDSGeoCalculator;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictGeomMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageLogMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageNavigationMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageNavigation;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@Service
public class VoyageNavigationService {
@Autowired
private IVoyageNavigationMapper mNav;
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private IVoyageLogMapper mLog;
@Autowired
private IDictGeomMapper iGeom;
public List<VoyageNavigation> uploadNavigation(int voyage_id, List<String> array, String file_name,
HmeFrameOptr optr) {
HmeFrameAssertHelper.hasValue(array, "航次导航文件为空,请检查!");
List<VoyageNavigation> navArray = new ArrayList<>();
this.mNav.deleteByColumn("voyage_id", voyage_id);
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0)
break;
String[] values = HmeStringHelper.splitWithSpace(array.get(i));
if (values.length < 3) {
throwError(i, "列不足至少需要3列");
}
String lon = values[0];
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
// try {
// double d = Double.parseDouble(lon);
// if (d > 180)
// throwError(i, "经度[" + lon + "]不能大于 180°");
// if (d < 0)
// throwError(i, "经度[" + lon + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "经度[" + lon + "]格式错误");
// }
// try {
// double d = Double.parseDouble(lat);
// if (d > 90)
// throwError(i, "纬度[" + lat + "]不能大于 90°");
// if (d < 0)
// throwError(i, "纬度[" + lat + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "纬度[" + lat + "]格式错误");
// }
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = HmeLocalDateHelper
.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3].replace(".000", ""));
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
VoyageNavigation nav = new VoyageNavigation();
nav.setNav_lat(lat);
nav.setNav_lon(lon);
nav.setNav_time(curTime);
nav.setVoyage_id(voyage_id);
// 判断时间是否重复了
// List<VoyageNavigation> vArray = this.mNav.selectList(SqlBuilder.create().addSqlCondition(SqlCondition.of("voyage_id", voyage_id)).addSqlCondition(SqlCondition.of("nav_time", curTime)));
// if (vArray.size() == 0) {
this.mNav.insert(nav);
navArray.add(nav);
// }
}
if (navArray.size() > 0) {
VoyageReg voyage = new VoyageReg();
voyage.setTsy_id(voyage_id);
voyage.setNavigation_file_name(file_name);
// 计算海里数目
Double dValue = DSDSGeoCalculator.calcuateVoyage(navArray);
voyage.setVoyage_mileage(dValue.intValue());
this.mVoyage.update(voyage);
// 写入图层
this.iGeom.createVoyage(this.mVoyage.find(voyage_id).getVoyage_name());
VoyageRegService.logVoyage(mLog, voyage_id, optr, VoyageLogType.UploadNavigation,
"成功导入[" + navArray.size() + "]条导航记录");
}
return navArray;
}
public void throwError(int row, String msg) {
throw new BusinessException("航次导航文件导入失败->第[" + (row + 1) + "]行:" + msg);
}
}
package cn.tsy.cas.idsse.dsds.service.voyage;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.lang.HmeStringHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.tsy.cas.idsse.dsds.constant.VoyageLogType;
import cn.tsy.cas.idsse.dsds.helper.DSDSGeoCalculator;
import cn.tsy.data.cas.idsse.dsds.mapper.dict.IDictGeomMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageLogMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageNavigationMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageNavigation;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@Service
public class VoyageNavigationService {
@Autowired
private IVoyageNavigationMapper mNav;
@Autowired
private IVoyageRegMapper mVoyage;
@Autowired
private IVoyageLogMapper mLog;
@Autowired
private IDictGeomMapper iGeom;
public List<VoyageNavigation> uploadNavigation(int voyage_id, List<String> array, String file_name,
HmeFrameOptr optr) {
HmeFrameAssertHelper.hasValue(array, "航次导航文件为空,请检查!");
List<VoyageNavigation> navArray = new ArrayList<>();
this.mNav.deleteByColumn("voyage_id", voyage_id);
for (int i = 0; i < array.size(); i++) {
if (array.get(i).trim().length() == 0)
break;
String[] values = HmeStringHelper.splitWithSpace(array.get(i));
if (values.length < 3) {
throwError(i, "列不足至少需要3列");
}
String lon = values[0];
String lat = values[1];
String time = values[2];
// 经纬度的范围包括经度范围0°-180°和纬度范围0°-90°
// try {
// double d = Double.parseDouble(lon);
// if (d > 180)
// throwError(i, "经度[" + lon + "]不能大于 180°");
// if (d < 0)
// throwError(i, "经度[" + lon + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "经度[" + lon + "]格式错误");
// }
// try {
// double d = Double.parseDouble(lat);
// if (d > 90)
// throwError(i, "纬度[" + lat + "]不能大于 90°");
// if (d < 0)
// throwError(i, "纬度[" + lat + "]不能小于 0°");
// } catch (Exception e) {
// throwError(i, "纬度[" + lat + "]格式错误");
// }
// 109.49100 18.23400 2023-09-18-21:58:35
String[] vs = time.split("-");
if (vs.length != 4)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
LocalDateTime curTime = HmeLocalDateHelper
.parseDateTime(vs[0] + "-" + vs[1] + "-" + vs[2] + " " + vs[3].replace(".000", ""));
if (curTime == null)
throwError(i, "时间[" + time + "]格式错误,样例 2023-09-18-21:58:35");
// 判断通过
VoyageNavigation nav = new VoyageNavigation();
nav.setNav_lat(lat);
nav.setNav_lon(lon);
nav.setNav_time(curTime);
nav.setVoyage_id(voyage_id);
// 判断时间是否重复了
// List<VoyageNavigation> vArray = this.mNav.selectList(SqlBuilder.create().addSqlCondition(SqlCondition.of("voyage_id", voyage_id)).addSqlCondition(SqlCondition.of("nav_time", curTime)));
// if (vArray.size() == 0) {
this.mNav.insert(nav);
navArray.add(nav);
// }
}
if (navArray.size() > 0) {
VoyageReg voyage = new VoyageReg();
voyage.setTsy_id(voyage_id);
voyage.setNavigation_file_name(file_name);
// 计算海里数目
Double dValue = DSDSGeoCalculator.calcuateVoyage(navArray);
voyage.setVoyage_mileage(dValue.intValue());
this.mVoyage.update(voyage);
// 写入图层
this.iGeom.createVoyage(this.mVoyage.find(voyage_id).getVoyage_name());
VoyageRegService.logVoyage(mLog, voyage_id, optr, VoyageLogType.UploadNavigation,
"成功导入[" + navArray.size() + "]条导航记录");
}
return navArray;
}
public void throwError(int row, String msg) {
throw new BusinessException("航次导航文件导入失败->第[" + (row + 1) + "]行:" + msg);
}
}

View File

@ -1,27 +1,27 @@
package cn.tsy.cas.idsse.dsds.service.voyage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegOptrMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageRegOptr;
@Service
public class VoyageRegOptrService {
@Autowired
private IVoyageRegOptrMapper iOptr;
public void save(int optr_id,Integer[] voyage_ids) {
this.iOptr.deleteByColumn("optr_id", optr_id);
for(int voyage_id:voyage_ids ) {
VoyageRegOptr m = new VoyageRegOptr();
m.setVoyage_id(voyage_id);
m.setOptr_id(optr_id);
this.iOptr.insert(m);
}
}
public void clear(int optr_id) {
this.iOptr.deleteByColumn("optr_id", optr_id);
}
}
package cn.tsy.cas.idsse.dsds.service.voyage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegOptrMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageRegOptr;
@Service
public class VoyageRegOptrService {
@Autowired
private IVoyageRegOptrMapper iOptr;
public void save(int optr_id,Integer[] voyage_ids) {
this.iOptr.deleteByColumn("optr_id", optr_id);
for(int voyage_id:voyage_ids ) {
VoyageRegOptr m = new VoyageRegOptr();
m.setVoyage_id(voyage_id);
m.setOptr_id(optr_id);
this.iOptr.insert(m);
}
}
public void clear(int optr_id) {
this.iOptr.deleteByColumn("optr_id", optr_id);
}
}

View File

@ -1,134 +1,134 @@
package cn.tsy.cas.idsse.dsds.service.voyage;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.constant.HmeFrameStatus;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.tsy.cas.idsse.dsds.constant.VoyageLogType;
import cn.tsy.cas.idsse.dsds.constant.VoyageStatus;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageLogMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageLog;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageNavigation;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@Service
public class VoyageRegService {
@Autowired
private IVoyageRegMapper mReg;
@Autowired
private IVoyageLogMapper mLog;
/***********************
* 增加或者修改
*/
public void editVoyage(VoyageReg voyage, HmeFrameOptr optr) {
HmeFrameAssertHelper.isNotEmpty(voyage.getVoyage_name(), "航次名称不允许为空!");
HmeFrameAssertHelper.isNotNull(voyage.getVoyage_start_date(), "航次离港日期不允许为空!");
HmeFrameAssertHelper.isNotNull(voyage.getVoyage_end_date(), "航次返岗日期不允许为空!");
if (voyage.getVoyage_end_date().isBefore(voyage.getVoyage_start_date()))
throw new BusinessException("航次返港日期不能小于离港日期!");
// 判断类型是否存在
List<VoyageReg> list = this.mReg.listByColumn("voyage_name", voyage.getVoyage_name());
if (voyage.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - voyage.getTsy_id() != 0)
throw new BusinessException("航次名称【" + voyage.getVoyage_name() + "】已经存在,请检查!");
this.mReg.update(voyage);
} else {
HmeFrameAssertHelper.isEmpty(list, "航次名称名称【" + voyage.getVoyage_name() + "】已经存在,请检查!");
voyage.setCreate_time(LocalDateTime.now());
voyage.setVoyage_status(VoyageStatus.Plan);
voyage.setVoyage_status_time(LocalDateTime.now());
// 计算日期
voyage.setVoyage_days(HmeLocalDateHelper.calTimeDiff(voyage.getVoyage_end_date(), voyage.getVoyage_start_date()).intValue());
this.mReg.insert(voyage);
/***************
* 写航次日志
*/
logVoyage(this.mLog, voyage.getTsy_id(), optr, VoyageLogType.Create, voyage.getTsy_id() + "->" + voyage.getVoyage_name());
}
}
// 航次名称 科考船舶 涉密航次 航次任务简述 开始时间 结束时间 航次首席 航次资助机构 资助编号
public List<VoyageReg> uploadVoyage(List<List<String>> values) {
List<VoyageReg> array = new ArrayList<VoyageReg>();
for (int i = 0; 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 ship_name = list.get(1);
String secure_flag = list.get(2);
String remark = list.get(3);
String start_date = list.get(4);
String end_date = list.get(5);
String voyage_officer = list.get(6);
String funding_org = list.get(7);
String funding_code = list.get(8);
List<VoyageReg> vArray = this.mReg.listByColumn("voyage_name", voyage_name);
VoyageReg reg = null;
if(vArray.size()>0)
reg = vArray.get(0);
else
reg = new VoyageReg();
reg.setCreate_time(LocalDateTime.now());
reg.setFunding_code(funding_code);
reg.setFunding_org(funding_org);
reg.setSerect_status("".equals(secure_flag)?HmeFrameStatus.Active.toString():HmeFrameStatus.InActive.toString());
reg.setShip_name(ship_name);
reg.setVoyage_end_date(HmeLocalDateHelper.parseDate(end_date));
reg.setVoyage_start_date(HmeLocalDateHelper.parseDate(start_date));
reg.setVoyage_name(voyage_name);
reg.setVoyage_officer(voyage_officer);
reg.setVoyage_remark(remark);
reg.setVoyage_status("Plan");
reg.setVoyage_status_time(LocalDateTime.now());
reg.setVoyage_days(HmeLocalDateHelper.calTimeDiff(reg.getVoyage_end_date(), reg.getVoyage_start_date()).intValue());
if(reg.getTsy_id()==null)
this.mReg.insert(reg);
else
this.mReg.update(reg);
array.add(reg);
}
return array;
}
/****************
* 删除航次信息
*
*/
public void deleteVoyage(int voyage_id) {
/****************
* @todo 判断是否能实际删除
*/
this.mLog.deleteByColumn("voyage_id", voyage_id);
this.mLog.deleteOtherByColumn(VoyageNavigation.class, "voyage_id", voyage_id);
this.mLog.deleteOtherByColumn(VoyageMember.class, "voyage_id", voyage_id);
this.mReg.delete(voyage_id);
}
public static VoyageLog logVoyage(IVoyageLogMapper mLog, int voyage_id, HmeFrameOptr optr, String log_type, String log_value) {
VoyageLog log = new VoyageLog();
log.setLog_type(log_type);
log.setLog_value(log_value);
log.setLogin_name(optr.getLogin_name());
log.setOptr_id(optr.getOptr_id());
log.setOptr_name(optr.getOptr_name());
log.setVoyage_id(voyage_id);
mLog.insert(log);
return log;
}
}
package cn.tsy.cas.idsse.dsds.service.voyage;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hme.data.frame.model.HmeFrameOptr;
import cn.hme.framework.exception.BusinessException;
import cn.hme.framework.frame.constant.HmeFrameStatus;
import cn.hme.framework.frame.helper.HmeFrameAssertHelper;
import cn.hme.framework.helper.time.HmeLocalDateHelper;
import cn.tsy.cas.idsse.dsds.constant.VoyageLogType;
import cn.tsy.cas.idsse.dsds.constant.VoyageStatus;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageLogMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageLog;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageNavigation;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageReg;
@Service
public class VoyageRegService {
@Autowired
private IVoyageRegMapper mReg;
@Autowired
private IVoyageLogMapper mLog;
/***********************
* 增加或者修改
*/
public void editVoyage(VoyageReg voyage, HmeFrameOptr optr) {
HmeFrameAssertHelper.isNotEmpty(voyage.getVoyage_name(), "航次名称不允许为空!");
HmeFrameAssertHelper.isNotNull(voyage.getVoyage_start_date(), "航次离港日期不允许为空!");
HmeFrameAssertHelper.isNotNull(voyage.getVoyage_end_date(), "航次返岗日期不允许为空!");
if (voyage.getVoyage_end_date().isBefore(voyage.getVoyage_start_date()))
throw new BusinessException("航次返港日期不能小于离港日期!");
// 判断类型是否存在
List<VoyageReg> list = this.mReg.listByColumn("voyage_name", voyage.getVoyage_name());
if (voyage.getTsy_id() != null) {
if (list.size() > 0 && list.get(0).getTsy_id() - voyage.getTsy_id() != 0)
throw new BusinessException("航次名称【" + voyage.getVoyage_name() + "】已经存在,请检查!");
this.mReg.update(voyage);
} else {
HmeFrameAssertHelper.isEmpty(list, "航次名称名称【" + voyage.getVoyage_name() + "】已经存在,请检查!");
voyage.setCreate_time(LocalDateTime.now());
voyage.setVoyage_status(VoyageStatus.Plan);
voyage.setVoyage_status_time(LocalDateTime.now());
// 计算日期
voyage.setVoyage_days(HmeLocalDateHelper.calTimeDiff(voyage.getVoyage_end_date(), voyage.getVoyage_start_date()).intValue());
this.mReg.insert(voyage);
/***************
* 写航次日志
*/
logVoyage(this.mLog, voyage.getTsy_id(), optr, VoyageLogType.Create, voyage.getTsy_id() + "->" + voyage.getVoyage_name());
}
}
// 航次名称 科考船舶 涉密航次 航次任务简述 开始时间 结束时间 航次首席 航次资助机构 资助编号
public List<VoyageReg> uploadVoyage(List<List<String>> values) {
List<VoyageReg> array = new ArrayList<VoyageReg>();
for (int i = 0; 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 ship_name = list.get(1);
String secure_flag = list.get(2);
String remark = list.get(3);
String start_date = list.get(4);
String end_date = list.get(5);
String voyage_officer = list.get(6);
String funding_org = list.get(7);
String funding_code = list.get(8);
List<VoyageReg> vArray = this.mReg.listByColumn("voyage_name", voyage_name);
VoyageReg reg = null;
if(vArray.size()>0)
reg = vArray.get(0);
else
reg = new VoyageReg();
reg.setCreate_time(LocalDateTime.now());
reg.setFunding_code(funding_code);
reg.setFunding_org(funding_org);
reg.setSerect_status("".equals(secure_flag)?HmeFrameStatus.Active.toString():HmeFrameStatus.InActive.toString());
reg.setShip_name(ship_name);
reg.setVoyage_end_date(HmeLocalDateHelper.parseDate(end_date));
reg.setVoyage_start_date(HmeLocalDateHelper.parseDate(start_date));
reg.setVoyage_name(voyage_name);
reg.setVoyage_officer(voyage_officer);
reg.setVoyage_remark(remark);
reg.setVoyage_status("Plan");
reg.setVoyage_status_time(LocalDateTime.now());
reg.setVoyage_days(HmeLocalDateHelper.calTimeDiff(reg.getVoyage_end_date(), reg.getVoyage_start_date()).intValue());
if(reg.getTsy_id()==null)
this.mReg.insert(reg);
else
this.mReg.update(reg);
array.add(reg);
}
return array;
}
/****************
* 删除航次信息
*
*/
public void deleteVoyage(int voyage_id) {
/****************
* @todo 判断是否能实际删除
*/
this.mLog.deleteByColumn("voyage_id", voyage_id);
this.mLog.deleteOtherByColumn(VoyageNavigation.class, "voyage_id", voyage_id);
this.mLog.deleteOtherByColumn(VoyageMember.class, "voyage_id", voyage_id);
this.mReg.delete(voyage_id);
}
public static VoyageLog logVoyage(IVoyageLogMapper mLog, int voyage_id, HmeFrameOptr optr, String log_type, String log_value) {
VoyageLog log = new VoyageLog();
log.setLog_type(log_type);
log.setLog_value(log_value);
log.setLogin_name(optr.getLogin_name());
log.setOptr_id(optr.getOptr_id());
log.setOptr_name(optr.getOptr_name());
log.setVoyage_id(voyage_id);
mLog.insert(log);
return log;
}
}

View File

@ -1,66 +1,66 @@
package cn.tsy.cas.idsse.dsds.thread;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import cn.hme.framework.helper.core.HmeSpringHelper;
import cn.hme.framework.helper.thread.HmeThreadHelper;
import cn.hme.framework.jdbc.entity.SqlCondition;
import cn.tsy.cas.idsse.dsds.helper.DSDSParamHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleStationMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
/**********************
* 缓存首页的统计数字
* @author TsySoft
* @create 2024-09-02 11:13:42
* @version 1.0.0
* @email revisit@126.com
*
*/
public class DSDSReportThread implements Runnable{
public static Map<String,Object> map = null;
public DSDSReportThread() {
map = new LinkedHashMap<String, Object>();
}
@Override
public void run() {
while(true) {
try {
this.report();
}catch(Exception e) {
}
HmeThreadHelper.sleepSeconds(DSDSParamHelper.ReportMainTicketSeconds);
}
}
private void report() {
// 数据集
map.put("DatasetTotal", HmeSpringHelper.getBean(ISampleDatasetMapper.class).count()) ;
// 样品数量
map.put("DataTotal", HmeSpringHelper.getBean(ISampleLineMapper.class).count()
+ HmeSpringHelper.getBean(ISampleStationMapper.class).count()) ;
List<Map<String,Object>> array = HmeSpringHelper.getBean(IVoyageRegMapper.class).totalVoyage(null, null);
if(array.size()>0) {
// 航次个数
map.put("VoyageTotal",array.get(0).get("voyage_total")) ;
// 航线天数
map.put("DayTotal",array.get(0).get("day_total"));
// 航行里程
map.put("MileageTotal",array.get(0).get("mileage_total"));
}
// 深海勇士
map.put("ShenHaiTotal",HmeSpringHelper.getBean(ISampleDatasetMapper.class).count(SqlCondition.of("platform_name", "深海勇士")));
// 奋斗者
map.put("FenDouTotal",HmeSpringHelper.getBean(ISampleDatasetMapper.class).count(SqlCondition.of("platform_name", "奋斗者")));
}
}
package cn.tsy.cas.idsse.dsds.thread;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import cn.hme.framework.helper.core.HmeSpringHelper;
import cn.hme.framework.helper.thread.HmeThreadHelper;
import cn.hme.framework.jdbc.entity.SqlCondition;
import cn.tsy.cas.idsse.dsds.helper.DSDSParamHelper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleLineMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.sample.ISampleStationMapper;
import cn.tsy.data.cas.idsse.dsds.mapper.voyage.IVoyageRegMapper;
/**********************
* 缓存首页的统计数字
* @author TsySoft
* @create 2024-09-02 11:13:42
* @version 1.0.0
* @email revisit@126.com
*
*/
public class DSDSReportThread implements Runnable{
public static Map<String,Object> map = null;
public DSDSReportThread() {
map = new LinkedHashMap<String, Object>();
}
@Override
public void run() {
while(true) {
try {
this.report();
}catch(Exception e) {
}
HmeThreadHelper.sleepSeconds(DSDSParamHelper.ReportMainTicketSeconds);
}
}
private void report() {
// 数据集
map.put("DatasetTotal", HmeSpringHelper.getBean(ISampleDatasetMapper.class).count()) ;
// 样品数量
map.put("DataTotal", HmeSpringHelper.getBean(ISampleLineMapper.class).count()
+ HmeSpringHelper.getBean(ISampleStationMapper.class).count()) ;
List<Map<String,Object>> array = HmeSpringHelper.getBean(IVoyageRegMapper.class).totalVoyage(null, null);
if(array.size()>0) {
// 航次个数
map.put("VoyageTotal",array.get(0).get("voyage_total")) ;
// 航线天数
map.put("DayTotal",array.get(0).get("day_total"));
// 航行里程
map.put("MileageTotal",array.get(0).get("mileage_total"));
}
// 深海勇士
map.put("ShenHaiTotal",HmeSpringHelper.getBean(ISampleDatasetMapper.class).count(SqlCondition.of("platform_name", "深海勇士")));
// 奋斗者
map.put("FenDouTotal",HmeSpringHelper.getBean(ISampleDatasetMapper.class).count(SqlCondition.of("platform_name", "奋斗者")));
}
}

View File

@ -1,32 +1,32 @@
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.cas.idsse.dsds.control.search.SearchParam;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictData;
@HmeMapper
public interface IDictDataMapper extends IHmeMapper<DictData>{
public Pageable dataWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
public Pageable searchWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
@Param("param") SearchParam param
);
}
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.cas.idsse.dsds.control.search.SearchParam;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictData;
@HmeMapper
public interface IDictDataMapper extends IHmeMapper<DictData>{
public Pageable dataWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
public Pageable searchWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
@Param("param") SearchParam param
);
}

View File

@ -1,59 +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.cas.idsse.dsds.mapper.dict.IDictDataMapper">
<!-- 分页查询 -->
<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},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>
<?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.cas.idsse.dsds.mapper.dict.IDictDataMapper">
<!-- 分页查询 -->
<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},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>

View File

@ -1,32 +1,32 @@
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.cas.idsse.dsds.control.search.SearchParam;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictEquipment;
@HmeMapper
public interface IDictEquipmentMapper extends IHmeMapper<DictEquipment>{
public Pageable equipmentWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
public Pageable searchWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
@Param("param") SearchParam param
);
}
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.cas.idsse.dsds.control.search.SearchParam;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictEquipment;
@HmeMapper
public interface IDictEquipmentMapper extends IHmeMapper<DictEquipment>{
public Pageable equipmentWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
public Pageable searchWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
@Param("param") SearchParam param
);
}

View File

@ -1,61 +1,61 @@
<?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.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper">
<!-- 分页查询 -->
<select id="equipmentWithPage" resultType="map">
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_alias like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>
<?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.cas.idsse.dsds.mapper.dict.IDictEquipmentMapper">
<!-- 分页查询 -->
<select id="equipmentWithPage" resultType="map">
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_alias like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>

View File

@ -1,21 +1,21 @@
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictFunding;
@HmeMapper
public interface IDictFundingMapper extends IHmeMapper<DictFunding>{
public Pageable fundingWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
}
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictFunding;
@HmeMapper
public interface IDictFundingMapper extends IHmeMapper<DictFunding>{
public Pageable fundingWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
}

View File

@ -1,22 +1,22 @@
<?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.cas.idsse.dsds.mapper.dict.IDictFundingMapper">
<!-- 分页查询 -->
<select id="fundingWithPage" resultType="map">
select * from dict_funding where 1=1
<if test="page_query != null and page_query != ''">
and (funding_name like concat('%',#{page_query},'%') or funding_eng like concat('%',#{page_query},'%') )
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<?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.cas.idsse.dsds.mapper.dict.IDictFundingMapper">
<!-- 分页查询 -->
<select id="fundingWithPage" resultType="map">
select * from dict_funding where 1=1
<if test="page_query != null and page_query != ''">
and (funding_name like concat('%',#{page_query},'%') or funding_eng like concat('%',#{page_query},'%') )
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
</mapper>

View File

@ -1,14 +1,14 @@
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictGeom;
@HmeMapper
public interface IDictGeomMapper extends IHmeMapper<DictGeom>{
int createVoyage(@Param("voyage_name") String voyage_name);
int createDiving(@Param("diving_sn") String diving_sn);
}
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictGeom;
@HmeMapper
public interface IDictGeomMapper extends IHmeMapper<DictGeom>{
int createVoyage(@Param("voyage_name") String voyage_name);
int createDiving(@Param("diving_sn") String diving_sn);
}

View File

@ -1,57 +1,57 @@
<?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.cas.idsse.dsds.mapper.dict.IDictGeomMapper">
<!-- 分页查询 -->
<update id="createVoyage">
delete from dict_geom where geom_sn=#{voyage_name};
INSERT INTO dict_geom ( geom_type, geom_sn, geom_value, create_time )
SELECT
'voyage',
voyage_name,
concat ( 'ST_GeomFromText(''LINESTRING(',string_agg ( concat ( nav_lon, '', nav_lat ), ',' ), ')''' ),
now( )
FROM
voyage_navigation v,
voyage_reg r
WHERE
v.voyage_id = r.tsy_id
where
r.voyage_name=#{voyage_name}
GROUP BY
v.voyage_id,
voyage_name
ORDER BY
v.voyage_id;
</update>
<!-- 分页查询 -->
<update id="createDiving">
delete from dict_geom where geom_sn=#{diving_sn};
INSERT INTO dict_geom ( geom_type, geom_sn, geom_value, create_time )
SELECT
'diving',
diving_sn,
concat ( 'ST_GeomFromText(''LINESTRING(', string_agg( concat ( track_lon, '', track_lat ), ',' ), ')''' ),
now( )
FROM
sample_dataset_track v,
sample_dataset r
WHERE
v.dataset_id = r.tsy_id
where r.diving_sn=#{diving_sn}
GROUP BY
r.diving_sn
ORDER BY
r.diving_sn;
</update>
<?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.cas.idsse.dsds.mapper.dict.IDictGeomMapper">
<!-- 分页查询 -->
<update id="createVoyage">
delete from dict_geom where geom_sn=#{voyage_name};
INSERT INTO dict_geom ( geom_type, geom_sn, geom_value, create_time )
SELECT
'voyage',
voyage_name,
concat ( 'ST_GeomFromText(''LINESTRING(',string_agg ( concat ( nav_lon, '', nav_lat ), ',' ), ')''' ),
now( )
FROM
voyage_navigation v,
voyage_reg r
WHERE
v.voyage_id = r.tsy_id
where
r.voyage_name=#{voyage_name}
GROUP BY
v.voyage_id,
voyage_name
ORDER BY
v.voyage_id;
</update>
<!-- 分页查询 -->
<update id="createDiving">
delete from dict_geom where geom_sn=#{diving_sn};
INSERT INTO dict_geom ( geom_type, geom_sn, geom_value, create_time )
SELECT
'diving',
diving_sn,
concat ( 'ST_GeomFromText(''LINESTRING(', string_agg( concat ( track_lon, '', track_lat ), ',' ), ')''' ),
now( )
FROM
sample_dataset_track v,
sample_dataset r
WHERE
v.dataset_id = r.tsy_id
where r.diving_sn=#{diving_sn}
GROUP BY
r.diving_sn
ORDER BY
r.diving_sn;
</update>
</mapper>

View File

@ -1,32 +1,32 @@
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.cas.idsse.dsds.control.search.SearchParam;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictPlatform;
@HmeMapper
public interface IDictPlatformMapper extends IHmeMapper<DictPlatform>{
public Pageable platformWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
public Pageable searchWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
@Param("param") SearchParam param
);
}
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.cas.idsse.dsds.control.search.SearchParam;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictPlatform;
@HmeMapper
public interface IDictPlatformMapper extends IHmeMapper<DictPlatform>{
public Pageable platformWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
public Pageable searchWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
@Param("param") SearchParam param
);
}

View File

@ -1,59 +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.cas.idsse.dsds.mapper.dict.IDictPlatformMapper">
<!-- 分页查询 -->
<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},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>
<?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.cas.idsse.dsds.mapper.dict.IDictPlatformMapper">
<!-- 分页查询 -->
<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},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_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>

View File

@ -1,10 +1,10 @@
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictReport;
@HmeMapper
public interface IDictReportMapper extends IHmeMapper<DictReport>{
}
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictReport;
@HmeMapper
public interface IDictReportMapper extends IHmeMapper<DictReport>{
}

View File

@ -1,21 +1,21 @@
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitSail;
@HmeMapper
public interface IDictUnitSailMapper extends IHmeMapper<DictUnitSail>{
public Pageable sailWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
}
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitSail;
@HmeMapper
public interface IDictUnitSailMapper extends IHmeMapper<DictUnitSail>{
public Pageable sailWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
}

View File

@ -1,23 +1,23 @@
<?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.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper">
<!-- 分页查询 -->
<select id="sailWithPage" resultType="map">
select * from dict_unit_sail where 1=1
<if test="page_query != null and page_query != ''">
and (unit_name like concat('%',#{page_query},'%') or link_man like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<?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.cas.idsse.dsds.mapper.dict.IDictUnitSailMapper">
<!-- 分页查询 -->
<select id="sailWithPage" resultType="map">
select * from dict_unit_sail where 1=1
<if test="page_query != null and page_query != ''">
and (unit_name like concat('%',#{page_query},'%') or link_man like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
</mapper>

View File

@ -1,22 +1,22 @@
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitShare;
@HmeMapper
public interface IDictUnitShareMapper extends IHmeMapper<DictUnitShare>{
public Pageable shareWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
}
package cn.tsy.data.cas.idsse.dsds.mapper.dict;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.dict.DictUnitShare;
@HmeMapper
public interface IDictUnitShareMapper extends IHmeMapper<DictUnitShare>{
public Pageable shareWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
}

View File

@ -1,23 +1,23 @@
<?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.cas.idsse.dsds.mapper.dict.IDictUnitShareMapper">
<!-- 分页查询 -->
<select id="shareWithPage" resultType="map">
select * from dict_unit_share where 1=1
<if test="page_query != null and page_query != ''">
and (unit_name like concat('%',#{page_query},'%') or link_man like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<?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.cas.idsse.dsds.mapper.dict.IDictUnitShareMapper">
<!-- 分页查询 -->
<select id="shareWithPage" resultType="map">
select * from dict_unit_share where 1=1
<if test="page_query != null and page_query != ''">
and (unit_name like concat('%',#{page_query},'%') or link_man like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
</mapper>

View File

@ -1,21 +1,21 @@
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
@HmeMapper
public interface ISampleDatasetMapper extends IHmeMapper<SampleDataset>{
public Pageable datasetWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
}
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDataset;
@HmeMapper
public interface ISampleDatasetMapper extends IHmeMapper<SampleDataset>{
public Pageable datasetWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type
);
}

View File

@ -1,28 +1,28 @@
<?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.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper">
<!-- 分页查询 -->
<select id="datasetWithPage" resultType="map">
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 where 1=1
<if test="page_query != null and page_query != ''">
and (dataset_name like concat('%',#{page_query},'%') or voyage_name like concat('%',#{page_query},'%')
or platform_type like concat('%',#{page_query},'%') or equipment_type like concat('%',#{query},'%')
or platform_name like concat('%',#{page_query},'%') or dataset_remark like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
<?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.cas.idsse.dsds.mapper.sample.ISampleDatasetMapper">
<!-- 分页查询 -->
<select id="datasetWithPage" resultType="map">
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 where 1=1
<if test="page_query != null and page_query != ''">
and (dataset_name like concat('%',#{page_query},'%') or voyage_name like concat('%',#{page_query},'%')
or platform_type like concat('%',#{page_query},'%') or equipment_type like concat('%',#{query},'%')
or platform_name like concat('%',#{page_query},'%') or dataset_remark like concat('%',#{page_query},'%'))
</if>
<if test="page_order != null and page_order != ''">
ORDER BY ${page_order}
</if>
<if test="page_type != null and page_type == 'DESC'">
DESC
</if>
</select>
</mapper>

View File

@ -1,17 +1,17 @@
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDatasetTrack;
@HmeMapper
public interface ISampleDatasetTrackMapper extends IHmeMapper<SampleDatasetTrack>{
public Map<String,Object> totalTrack(@Param("dataset_id") int dataset_id);
public List<Map<String,Object>> listTrack(@Param("dataset_id") int dataset_id,@Param("ticket_minutes") int ticket_minutes);
}
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleDatasetTrack;
@HmeMapper
public interface ISampleDatasetTrackMapper extends IHmeMapper<SampleDatasetTrack>{
public Map<String,Object> totalTrack(@Param("dataset_id") int dataset_id);
public List<Map<String,Object>> listTrack(@Param("dataset_id") int dataset_id,@Param("ticket_minutes") int ticket_minutes);
}

View File

@ -1,42 +1,42 @@
<?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.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper">
<select id="totalTrack" resultType="map">
select max(track_time) max_time,min(track_time) min_time,max(track_lon)
max_lon,min(track_lon) min_lin,max(track_lat) max_lat,min(track_lat)
min_lat from sample_dataset_track where dataset_id=#{dataset_id};
</select>
<select id="listTrack" resultType="map">
SELECT
t1.*
FROM
sample_dataset_track t1,(
SELECT
min( tsy_id ) tsy_id
FROM
(
SELECT
track_time,
DATE_FORMAT( track_time, '%Y-%m-%d %H:%i' ) track_minute,
tsy_id
FROM
sample_dataset_track k
WHERE
dataset_id = #{dataset_id}
AND MOD ( MINUTE ( track_time ), ${ticket_minutes} )= 0
) s
GROUP BY
track_minute
) t2
WHERE
t1.tsy_id = t2.tsy_id
AND t1.dataset_id = #{dataset_id}
ORDER BY
t1.track_time
</select>
<?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.cas.idsse.dsds.mapper.sample.ISampleDatasetTrackMapper">
<select id="totalTrack" resultType="map">
select max(track_time) max_time,min(track_time) min_time,max(track_lon)
max_lon,min(track_lon) min_lin,max(track_lat) max_lat,min(track_lat)
min_lat from sample_dataset_track where dataset_id=#{dataset_id};
</select>
<select id="listTrack" resultType="map">
SELECT
t1.*
FROM
sample_dataset_track t1,(
SELECT
min( tsy_id ) tsy_id
FROM
(
SELECT
track_time,
DATE_FORMAT( track_time, '%Y-%m-%d %H:%i' ) track_minute,
tsy_id
FROM
sample_dataset_track k
WHERE
dataset_id = #{dataset_id}
AND MOD ( MINUTE ( track_time ), ${ticket_minutes} )= 0
) s
GROUP BY
track_minute
) t2
WHERE
t1.tsy_id = t2.tsy_id
AND t1.dataset_id = #{dataset_id}
ORDER BY
t1.track_time
</select>
</mapper>

View File

@ -1,10 +1,10 @@
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
@HmeMapper
public interface ISampleLineMapper extends IHmeMapper<SampleLine>{
}
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLine;
@HmeMapper
public interface ISampleLineMapper extends IHmeMapper<SampleLine>{
}

View File

@ -1,10 +1,10 @@
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLineTrack;
@HmeMapper
public interface ISampleLineTrackMapper extends IHmeMapper<SampleLineTrack>{
}
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleLineTrack;
@HmeMapper
public interface ISampleLineTrackMapper extends IHmeMapper<SampleLineTrack>{
}

View File

@ -1,13 +1,13 @@
<?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.cas.idsse.dsds.mapper.sample.ISampleLineTrackMapper">
<select id="totalTrack" resultType="map">
select max(track_time) max_time,min(track_time) min_time,max(track_lon) max_lon,min(track_lon) min_lin,max(track_lat) max_lat,
min(track_lat) min_lat from sample_line_track where line_id=#{line_id};
</select>
<?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.cas.idsse.dsds.mapper.sample.ISampleLineTrackMapper">
<select id="totalTrack" resultType="map">
select max(track_time) max_time,min(track_time) min_time,max(track_lon) max_lon,min(track_lon) min_lin,max(track_lat) max_lat,
min(track_lat) min_lat from sample_line_track where line_id=#{line_id};
</select>
</mapper>

View File

@ -1,10 +1,10 @@
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStation;
@HmeMapper
public interface ISampleStationMapper extends IHmeMapper<SampleStation>{
}
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStation;
@HmeMapper
public interface ISampleStationMapper extends IHmeMapper<SampleStation>{
}

View File

@ -1,10 +1,10 @@
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStationTrack;
@HmeMapper
public interface ISampleStationTrackMapper extends IHmeMapper<SampleStationTrack>{
}
package cn.tsy.data.cas.idsse.dsds.mapper.sample;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.sample.SampleStationTrack;
@HmeMapper
public interface ISampleStationTrackMapper extends IHmeMapper<SampleStationTrack>{
}

View File

@ -1,10 +1,10 @@
package cn.tsy.data.cas.idsse.dsds.mapper.voyage;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageLog;
@HmeMapper
public interface IVoyageLogMapper extends IHmeMapper<VoyageLog>{
}
package cn.tsy.data.cas.idsse.dsds.mapper.voyage;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageLog;
@HmeMapper
public interface IVoyageLogMapper extends IHmeMapper<VoyageLog>{
}

View File

@ -1,22 +1,22 @@
package cn.tsy.data.cas.idsse.dsds.mapper.voyage;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
@HmeMapper
public interface IVoyageMemberMapper extends IHmeMapper<VoyageMember>{
public Pageable memberWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
@Param("voyage_id") int voyage_id
);
}
package cn.tsy.data.cas.idsse.dsds.mapper.voyage;
import org.apache.ibatis.annotations.Param;
import cn.hme.framework.jdbc.constant.SqlProviderConstant;
import cn.hme.framework.jdbc.core.HmeMapper;
import cn.hme.framework.jdbc.entity.Pageable;
import cn.hme.framework.jdbc.mapper.IHmeMapper;
import cn.tsy.data.cas.idsse.dsds.model.voyage.VoyageMember;
@HmeMapper
public interface IVoyageMemberMapper extends IHmeMapper<VoyageMember>{
public Pageable memberWithPage(
@Param(SqlProviderConstant.PARAM_PAGE_GROUP) Integer group,
@Param(SqlProviderConstant.PARAM_PAGE_START) Integer start,
@Param(SqlProviderConstant.PARAM_PAGE_LIMIT) Integer limit,
@Param(SqlProviderConstant.PARAM_PAGE_QUERY) String query,
@Param(SqlProviderConstant.PARAM_PAGE_ORDER) String order,
@Param(SqlProviderConstant.PARAM_PAGE_TYPE) String type,
@Param("voyage_id") int voyage_id
);
}

Some files were not shown because too many files have changed in this diff Show More