pmsBUG提交
This commit is contained in:
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
@@ -19,14 +19,25 @@ import java.util.List;
|
||||
public interface PmsTerminalDetectionMapper extends BaseMapper<PmsTerminalDetection> {
|
||||
|
||||
/***
|
||||
* 终端入网检测台账统计
|
||||
* 单位-终端入网检测台账统计
|
||||
* @author wr
|
||||
* @date 2023-02-28 11:14
|
||||
* @param param
|
||||
* @param ids
|
||||
* @return List<TerminalStatistics>
|
||||
*/
|
||||
List<TerminalVO.TerminalStatistics> selectStatistics(@Param("param") TerminalParam param,
|
||||
List<TerminalVO.OrgStatistics> selectStatistics(@Param("param") TerminalParam param,
|
||||
@Param("ids") List<String> ids);
|
||||
|
||||
/***
|
||||
* 年度-终端入网检测台账统计
|
||||
* @author wr
|
||||
* @date 2023-02-28 11:14
|
||||
* @param param
|
||||
* @param ids
|
||||
* @return List<TerminalStatistics>
|
||||
*/
|
||||
List<TerminalVO.DateStatistics> selectDateStatistics(@Param("param") TerminalParam param,
|
||||
@Param("ids") List<String> ids);
|
||||
|
||||
/***
|
||||
@@ -37,6 +48,17 @@ public interface PmsTerminalDetectionMapper extends BaseMapper<PmsTerminalDetect
|
||||
* @param ids
|
||||
* @return List<TerminalStatistics>
|
||||
*/
|
||||
List<TerminalVO.TerminalStatistics> selectCycleStatistics(@Param("param") TerminalParam.TerminalCycleParam param,
|
||||
@Param("ids") List<String> ids);
|
||||
List<TerminalVO.OrgStatistics> selectCycleStatistics(@Param("param") TerminalParam param,
|
||||
@Param("ids") List<String> ids);
|
||||
|
||||
/***
|
||||
* 已开展/未开展-周期检测统计
|
||||
* @author wr
|
||||
* @date 2023-02-28 11:14
|
||||
* @param param
|
||||
* @param ids
|
||||
* @return List<TerminalStatistics>
|
||||
*/
|
||||
List<TerminalVO.ResultsStatistics> selectResultsCycleStatistics(@Param("param") TerminalParam param,
|
||||
@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
@@ -4,30 +4,30 @@
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.njcn.process.pojo.po.PmsTerminalDetection">
|
||||
<id column="Id" property="id" />
|
||||
<result column="Create_Time" property="createTime" />
|
||||
<result column="Update_Time" property="updateTime" />
|
||||
<result column="Name" property="name" />
|
||||
<result column="Org_Name" property="orgName" />
|
||||
<result column="Org_No" property="orgNo" />
|
||||
<result column="Manufacture" property="manufacture" />
|
||||
<result column="Install_place" property="installPlace" />
|
||||
<result column="Inspection_Name" property="inspectionName" />
|
||||
<result column="Test_results" property="testResults" />
|
||||
<result column="Inspection_Time" property="inspectionTime" />
|
||||
<result column="Next_inspection_Time" property="nextInspectionTime" />
|
||||
<result column="Inspection_Report" property="inspectionReport" />
|
||||
<result column="Original_Report" property="originalReport" />
|
||||
<result column="Status" property="status" />
|
||||
<result column="Create_By" property="createBy" />
|
||||
<result column="Update_By" property="updateBy" />
|
||||
<id column="Id" property="id"/>
|
||||
<result column="Create_Time" property="createTime"/>
|
||||
<result column="Update_Time" property="updateTime"/>
|
||||
<result column="Name" property="name"/>
|
||||
<result column="Org_Name" property="orgName"/>
|
||||
<result column="Org_No" property="orgNo"/>
|
||||
<result column="Manufacture" property="manufacture"/>
|
||||
<result column="Install_place" property="installPlace"/>
|
||||
<result column="Inspection_Name" property="inspectionName"/>
|
||||
<result column="Test_results" property="testResults"/>
|
||||
<result column="Inspection_Time" property="inspectionTime"/>
|
||||
<result column="Next_inspection_Time" property="nextInspectionTime"/>
|
||||
<result column="Inspection_Report" property="inspectionReport"/>
|
||||
<result column="Original_Report" property="originalReport"/>
|
||||
<result column="Status" property="status"/>
|
||||
<result column="Create_By" property="createBy"/>
|
||||
<result column="Update_By" property="updateBy"/>
|
||||
</resultMap>
|
||||
<select id="selectStatistics" resultType="com.njcn.process.pojo.vo.TerminalVO$TerminalStatistics">
|
||||
<select id="selectStatistics" resultType="com.njcn.process.pojo.vo.TerminalVO$OrgStatistics">
|
||||
SELECT
|
||||
Org_No,
|
||||
count( id ) AS count
|
||||
Org_No,
|
||||
count( id ) AS count
|
||||
FROM
|
||||
pms_terminal_detection
|
||||
pms_terminal_detection
|
||||
<where>
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND org_no IN
|
||||
@@ -36,16 +36,16 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND data_date >= #{param.startTime}
|
||||
AND Create_Time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND data_date <= #{param.endTime}
|
||||
AND Create_Time <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
Org_No
|
||||
Org_No
|
||||
</select>
|
||||
<select id="selectCycleStatistics" resultType="com.njcn.process.pojo.vo.TerminalVO$TerminalStatistics">
|
||||
<select id="selectCycleStatistics" resultType="com.njcn.process.pojo.vo.TerminalVO$OrgStatistics">
|
||||
SELECT
|
||||
Org_No,
|
||||
count( id ) AS count
|
||||
@@ -59,12 +59,73 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.testResults != null and param.testResults !=''">
|
||||
AND Test_results = #{param.testResults}
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND Create_Time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND Create_Time <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
Org_No
|
||||
</select>
|
||||
<select id="selectDateStatistics" resultType="com.njcn.process.pojo.vo.TerminalVO$DateStatistics">
|
||||
SELECT
|
||||
DATE_FORMAT(Create_Time,'%Y-%m-%d') as statisticsDate,
|
||||
count( id ) AS count
|
||||
FROM
|
||||
pms_terminal_detection
|
||||
<where>
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND Create_Time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND Create_Time <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
Create_Time
|
||||
</select>
|
||||
<select id="selectResultsCycleStatistics" resultType="com.njcn.process.pojo.vo.TerminalVO$ResultsStatistics">
|
||||
SELECT
|
||||
Org_Name,
|
||||
ifnull( GROUP_CONCAT( CASE WHEN Test_results = '0' THEN count END SEPARATOR '' ), 0 ) as notExpanded,
|
||||
ifnull( GROUP_CONCAT( CASE WHEN Test_results = '1' THEN count END SEPARATOR '' ), 0 ) as expanded
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
Org_Name,
|
||||
Test_results,
|
||||
count( id ) AS count
|
||||
FROM
|
||||
pms_terminal_detection
|
||||
<where>
|
||||
Next_inspection_Time <= DATE_FORMAT( now(), '%Y-%m-%d' )
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND org_no IN
|
||||
<foreach collection='ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND Create_Time >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param!=null and param.endTime != null and param.endTime != ''">
|
||||
AND Create_Time <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
Org_Name,
|
||||
Test_results
|
||||
) a
|
||||
GROUP BY
|
||||
Org_Name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user