暂降治理一期工作内容

This commit is contained in:
2024-04-19 14:33:14 +08:00
parent 0d71a74bdf
commit f2c3ce35ea
82 changed files with 4933 additions and 91 deletions

View File

@@ -0,0 +1,16 @@
package com.njcn.advance.mapper.govern.harmonic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.advance.pojo.po.govern.harmonic.SgHarmonicFile;
/**
* <p>
* Mapper 接口
* </p>
*
* @author hongawen
* @since 2024-04-17
*/
public interface SgHarmonicFileMapper extends BaseMapper<SgHarmonicFile> {
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.advance.mapper.govern.harmonic.SgHarmonicFileMapper">
</mapper>

View File

@@ -1,16 +1,27 @@
package com.njcn.advance.mapper.govern.voltage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.advance.pojo.po.govern.voltage.SgEvent;
import com.njcn.advance.pojo.vo.govern.voltage.SgEventVO;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.List;
/**
* <p>
* Mapper 接口
* Mapper 接口
* </p>
*
* @author hongawen
* @since 2024-02-29
*/
public interface SgEventMapper extends BaseMapper<SgEvent> {
Page<SgEventVO> page(@Param("page") Page<Object> objectPage, @Param("ew") QueryWrapper<SgEventVO> sgEventVOQueryWrapper);
List<SgEventVO> getAllEventData(@Param("incomingList") List<String> incomingLineIdList, @Param("beginDate") LocalDateTime beginDate, @Param("endDate") LocalDateTime endDate);
List<SgEventVO> getEventDataByProductLineId(@Param("productId") String productId, @Param("beginDate") LocalDateTime beginDate, @Param("endDate") LocalDateTime endDate);
}

View File

@@ -0,0 +1,16 @@
package com.njcn.advance.mapper.govern.voltage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.advance.pojo.po.govern.voltage.SgGovernSchemeHistoryDetail;
/**
* <p>
* Mapper 接口
* </p>
*
* @author hongawen
* @since 2024-03-27
*/
public interface SgGovernSchemeHistoryDetailMapper extends BaseMapper<SgGovernSchemeHistoryDetail> {
}

View File

@@ -0,0 +1,21 @@
package com.njcn.advance.mapper.govern.voltage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.advance.pojo.po.govern.voltage.SgGovernSchemeHistory;
import com.njcn.advance.pojo.vo.govern.voltage.SgGovernSchemeHistoryVO;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* Mapper 接口
* </p>
*
* @author hongawen
* @since 2024-03-27
*/
public interface SgGovernSchemeHistoryMapper extends BaseMapper<SgGovernSchemeHistory> {
Page<SgGovernSchemeHistoryVO> page(@Param("page") Page<SgGovernSchemeHistoryVO> objectPage, @Param("ew") QueryWrapper<SgGovernSchemeHistoryVO> queryWrapper);
}

View File

@@ -0,0 +1,16 @@
package com.njcn.advance.mapper.govern.voltage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.advance.pojo.po.govern.voltage.SgGovernSchemeParam;
/**
* <p>
* Mapper 接口
* </p>
*
* @author hongawen
* @since 2024-03-27
*/
public interface SgGovernSchemeParamMapper extends BaseMapper<SgGovernSchemeParam> {
}

View File

@@ -3,6 +3,7 @@ package com.njcn.advance.mapper.govern.voltage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.advance.pojo.po.govern.voltage.SgIncomingLine;
import com.njcn.advance.pojo.vo.govern.voltage.IncomingLineVO;
import com.njcn.advance.pojo.vo.govern.voltage.SgOption;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -18,4 +19,6 @@ import java.util.List;
public interface SgIncomingLineMapper extends BaseMapper<SgIncomingLine> {
List<IncomingLineVO> queryLineByUserId(@Param("userId")String userId);
List<SgOption> lineList();
}

View File

@@ -7,6 +7,8 @@ import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
@@ -18,4 +20,6 @@ import org.apache.ibatis.annotations.Param;
public interface SgMachineMapper extends BaseMapper<SgMachine> {
Page<SgMachineVO> page(@Param("page") Page<Object> objectPage, @Param("ew") QueryWrapper<SgMachineVO> queryWrapper);
List<SgMachineVO> listAllMachineByProductLineId(@Param("productLineId")String productLineId);
}

View File

@@ -7,6 +7,8 @@ import com.njcn.advance.pojo.po.govern.voltage.SgProductLine;
import com.njcn.advance.pojo.vo.govern.voltage.SgProductLineVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
@@ -20,4 +22,7 @@ public interface SgProductLineMapper extends BaseMapper<SgProductLine> {
Page<SgProductLineVO> page(@Param("page")Page<SgProductLineVO> objectPage, @Param("ew") QueryWrapper<SgProductLineVO> queryWrapper);
List<SgProductLineVO> querySgProductLineByUserId(@Param("ew") QueryWrapper<SgProductLineVO> sgProductLineVOQueryWrapper);
String getUserNameByProductId(@Param("productId")String id);
}

View File

@@ -7,6 +7,8 @@ import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
@@ -18,4 +20,6 @@ import org.apache.ibatis.annotations.Param;
public interface SgSensitiveUnitMapper extends BaseMapper<SgSensitiveUnit> {
Page<SgSensitiveUnitVO> page(@Param("page") Page<Object> objectPage, @Param("ew")QueryWrapper<SgSensitiveUnitVO> queryWrapper);
List<SgSensitiveUnitVO> listAllUnitByMachineId(@Param("machineId")String machineId);
}

View File

@@ -2,4 +2,44 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.advance.mapper.govern.voltage.SgEventMapper">
<!--获取暂降事件分页列表-->
<select id="page" resultType="SgEventVO">
SELECT sg_event.*,
sg_incoming_line.name incomingLineName
FROM sg_event sg_event,
sg_incoming_line sg_incoming_line
WHERE sg_event.incoming_line_id = sg_incoming_line.id
AND ${ew.sqlSegment}
</select>
<!--获取暂降事件,不分页-->
<select id="getAllEventData" resultType="SgEventVO">
SELECT sg_event.*,
sg_incoming_line.name incomingLineName
FROM sg_event sg_event,
sg_incoming_line sg_incoming_line
WHERE sg_event.incoming_line_id = sg_incoming_line.id
AND sg_event.incoming_line_id in
<foreach collection="incomingList" separator="," open="(" close=")" item="item">
#{item}
</foreach>
AND sg_event.start_time between #{beginDate} and #{endDate}
AND sg_event.state = 1
</select>
<!--获取生产下的所有事件-->
<select id="getEventDataByProductLineId" resultType="SgEventVO">
SELECT sg_event.*,
sg_incoming_line.name incomingLineName
FROM sg_event sg_event,
sg_incoming_line sg_incoming_line
WHERE sg_event.incoming_line_id = sg_incoming_line.id
AND sg_event.product_line_id = #{productId}
AND sg_event.start_time between #{beginDate} and #{endDate}
AND sg_event.state = 1
</select>
</mapper>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.advance.mapper.govern.voltage.SgGovernSchemeHistoryDetailMapper">
</mapper>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.advance.mapper.govern.voltage.SgGovernSchemeHistoryMapper">
<!--获取生产线分页列表-->
<select id="page" resultType="SgGovernSchemeHistoryVO">
SELECT
sg_govern_scheme_history.*,
sg_govern_scheme_history.loss - sg_govern_scheme_history_detail.loss governEffect,
sg_govern_scheme_history_detail.equipment schemeEquipment,
sg_govern_scheme_history_detail.maintain schemeMaintain,
sg_govern_scheme_history_detail.actual_pay_back payBackYear,
sg_govern_scheme_history_detail.type schemeType,
sg_product_line.name productLineName,
sg_user.user_name userName
FROM
sg_govern_scheme_history sg_govern_scheme_history ,
sg_govern_scheme_history_detail sg_govern_scheme_history_detail ,
sg_product_line sg_product_line,
sg_user sg_user
WHERE sg_govern_scheme_history.Best_scheme_id = sg_govern_scheme_history_detail.id
AND sg_govern_scheme_history.product_line_id = sg_product_line.id
AND sg_product_line.user_id = sg_user.id
AND ${ew.sqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.advance.mapper.govern.voltage.SgGovernSchemeParamMapper">
</mapper>

View File

@@ -16,4 +16,14 @@
ORDER BY sg_incoming_line.create_time desc
</select>
<select id="lineList" resultType="com.njcn.advance.pojo.vo.govern.voltage.SgOption">
SELECT
id id,
name name
FROM
pq_line
WHERE
Level = 6
</select>
</mapper>

View File

@@ -9,4 +9,12 @@
WHERE ${ew.sqlSegment}
</select>
<!--获取设备所有数据根据生产线ID-->
<select id="listAllMachineByProductLineId" resultType="SgMachineVO">
SELECT sg_machine.*
FROM sg_machine sg_machine
WHERE sg_machine.product_line_id = #{productLineId}
AND sg_machine.state = 1
</select>
</mapper>

View File

@@ -17,5 +17,31 @@
AND ${ew.sqlSegment}
</select>
<!--获取生产线分页列表-->
<select id="querySgProductLineByUserId" resultType="SgProductLineVO">
SELECT
sg_product_line.*,
sg_user.user_name userName,
sg_incoming_line.name incomingLineName
FROM
sg_product_line sg_product_line ,
sg_user sg_user ,
sg_incoming_line sg_incoming_line
WHERE sg_product_line.user_id = sg_user.id
AND sg_product_line.incoming_line_id = sg_incoming_line.id
AND ${ew.sqlSegment}
</select>
<select id="getUserNameByProductId" resultType="String">
SELECT sg_user.user_name userName
FROM sg_product_line sg_product_line,
sg_user sg_user
WHERE sg_product_line.user_id = sg_user.id
AND sg_product_line.id = #{productId}
</select>
</mapper>

View File

@@ -7,4 +7,12 @@
FROM sg_sensitive_unit sg_sensitive_unit
WHERE ${ew.sqlSegment}
</select>
<!--根据设备ID获取所有的敏感元器件-->
<select id="listAllUnitByMachineId" resultType="SgSensitiveUnitVO">
SELECT sg_sensitive_unit.*
FROM sg_sensitive_unit sg_sensitive_unit
WHERE sg_sensitive_unit.machine_id = #{machineId}
AND sg_sensitive_unit.state = 1
</select>
</mapper>