设备管理后端接口

master
马雪伟 3 days ago
parent 31f2ed26b9
commit 2c39c5732f

@ -2,6 +2,7 @@ package com.hw.dms.mapper;
import java.util.List;
import com.hw.dms.domain.DmsPlanMaintDetail;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -74,4 +75,5 @@ public interface DmsPlanMaintDetailMapper
List<DmsPlanMaintDetail> selectDmsPlanMaintDetailListByPlanMaintId(Long planMaintId);
Long selectStandardId(@Param("stationId") Long stationId);
}

@ -96,6 +96,10 @@ public class DmsInspectInstanceDetailProjectServiceImpl implements IDmsInspectIn
@Override
public List<DmsInspectInstanceDetailProject> selectDmsInspectInstanceDetailProjectByInspectInstanceId(Long inspectInstanceId, Long lineStep) {
return dmsInspectInstanceDetailProjectMapper.selectDmsInspectInstanceDetailProjectByInspectInstanceId(inspectInstanceId,lineStep);
List<DmsInspectInstanceDetailProject> detailProjects = dmsInspectInstanceDetailProjectMapper.selectDmsInspectInstanceDetailProjectByInspectInstanceId(inspectInstanceId, lineStep);
for (DmsInspectInstanceDetailProject detailProject : detailProjects) {
detailProject.setProjectStepOrder(lineStep);
}
return detailProjects;
}
}

@ -26,32 +26,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDmsBillsInspectInstanceVo">
select inspect_instance_id, plan_inspect_id, wf_process_id, inspect_type, bills_inspect_code, plan_begin_time,plan_end_time, real_begin_time, real_end_time, inspect_status, is_flag, remark, create_by, create_time, update_by, update_time from dms_bills_inspect_instance
select
a.inspect_instance_id,
a.plan_inspect_id,
a.wf_process_id,
a.inspect_type,
a.bills_inspect_code,
a.plan_begin_time,
a.plan_end_time,
a.real_begin_time,
a.real_end_time,
a.inspect_status,
a.is_flag,
b.remark,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
b.plan_inspect_code,
b.performer
from
dms_bills_inspect_instance a left join dms_plan_inspect b on a.plan_inspect_id = b.plan_inspect_id
</sql>
<select id="selectDmsBillsInspectInstanceList" parameterType="DmsBillsInspectInstance" resultMap="DmsBillsInspectInstanceResult">
<include refid="selectDmsBillsInspectInstanceVo"/>
<where>
<if test="planInspectId != null "> and plan_inspect_id like concat('%',#{planInspectId},'%') </if>
<if test="inspectInstanceId != null "> and inspect_instance_id = #{inspectInstanceId}</if>
<if test="wfProcessId != null "> and wf_process_id = #{wfProcessId}</if>
<if test="inspectType != null and inspectType != ''"> and inspect_type = #{inspectType}</if>
<if test="billsInspectCode != null and billsInspectCode != ''"> and bills_inspect_code = #{billsInspectCode}</if>
<if test="planBeginTime != null "> and plan_begin_time > #{planBeginTime}</if>
<if test="planEndTime != null "> and #{planEndTime}>plan_end_time </if>
<if test="realBeginTime != null "> and real_begin_time > #{realBeginTime}</if>
<if test="realEndTime != null "> and #{realEndTime}>real_end_time</if>
<if test="inspectStatus != null and inspectStatus != ''"> and inspect_status = #{inspectStatus}</if>
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
<if test="planInspectId != null "> and a.plan_inspect_id like concat('%',#{planInspectId},'%') </if>
<if test="inspectInstanceId != null "> and a.inspect_instance_id = #{inspectInstanceId}</if>
<if test="wfProcessId != null "> and a.wf_process_id = #{wfProcessId}</if>
<if test="inspectType != null and inspectType != ''"> and a.inspect_type = #{inspectType}</if>
<if test="billsInspectCode != null and billsInspectCode != ''"> and a.bills_inspect_code = #{billsInspectCode}</if>
<if test="planBeginTime != null "> and a.plan_begin_time > #{planBeginTime}</if>
<if test="planEndTime != null "> and #{planEndTime}>a.plan_end_time </if>
<if test="realBeginTime != null "> and a.real_begin_time > #{realBeginTime}</if>
<if test="realEndTime != null "> and #{realEndTime}>a.real_end_time</if>
<if test="inspectStatus != null and inspectStatus != ''"> and a.inspect_status = #{inspectStatus}</if>
<if test="isFlag != null and isFlag != ''"> and a.is_flag = #{isFlag}</if>
</where>
</select>
<select id="selectPoint" parameterType="DmsBillsInspectInstance" resultMap="DmsBillsInspectInstanceResult">
<include refid="selectDmsBillsInspectInstanceVo"/>
where inspect_type = 2
where a.inspect_type = 2
</select>
<select id="selectInspection" parameterType="DmsBillsInspectInstance" resultMap="DmsBillsInspectInstanceResult">
<include refid="selectDmsBillsInspectInstanceVo"/>
where inspect_type = 1
where a.inspect_type = 1
</select>
<select id="selectDmsBillsInspectInstanceByInspectInstanceId" parameterType="Long" resultMap="DmsBillsInspectInstanceResult">
@ -65,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planInspectId != null">plan_inspect_id,</if>
<if test="wfProcessId != null">wf_process_id,</if>
<if test="inspectType != null and inspectType != ''">inspect_type,</if>
<if test="inspectRouteId != null and inspectRouteId != ''">inspect_route_id,</if>
<if test="billsInspectCode != null">bills_inspect_code,</if>
<if test="planBeginTime != null">plan_begin_time,</if>
<if test="planEndTime != null">plan_end_time,</if>
@ -141,10 +162,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectNewestDmsBillsInspectInstance" parameterType="DmsBillsInspectInstance" resultMap="DmsBillsInspectInstanceResult">
select dbii.inspect_instance_id, dbii.plan_inspect_id, dbii.wf_process_id, dbii.inspect_type, dbii.bills_inspect_code,
dbii.plan_begin_time,dbii.plan_end_time, dbii.real_begin_time, dbii.real_end_time, dbii.inspect_status,dbii.create_time,
dbir.route_name
from dms_bills_inspect_instance dbii left join dms_base_inspect_route dbir on dbii.inspect_route_id=dbir.inspect_route_id
select
dbii.inspect_instance_id,
dbii.plan_inspect_id,
dbii.wf_process_id,
dbii.inspect_type,
dbii.bills_inspect_code,
dbii.plan_begin_time,
dbii.plan_end_time,
dbii.real_begin_time,
dbii.real_end_time,
dbii.inspect_status,
dbii.create_time,
dbir.route_name,a.plan_inspect_code
from
dms_bills_inspect_instance dbii
left join dms_base_inspect_route dbir on
dbii.inspect_route_id = dbir.inspect_route_id left join dms_plan_inspect a on dbii.plan_inspect_id = a.plan_inspect_id
<where>
<if test="inspectRouteId != null "> and dbii.inspect_route_id = #{inspectRouteId}</if>

@ -29,23 +29,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDmsBillsMaintInstanceVo">
select maint_instance_id, plan_maint_id, wf_process_id, bills_maint_code, plan_begin_time, real_begin_time, plan_end_time, real_end_time, maint_status, maint_comp_rate, is_flag, remark, create_by, create_time, update_by, update_time from dms_bills_maint_instance
select
a.maint_instance_id,
a.plan_maint_id,
a.wf_process_id,
a.bills_maint_code,
a.plan_begin_time,
a.real_begin_time,
a.plan_end_time,
a.real_end_time,
a.maint_status,
a.maint_comp_rate,
a.is_flag,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
b.maint_supervisor,
b.remark
from
dms_bills_maint_instance a left join dms_plan_maint b on a.plan_maint_id = b.plan_maint_id
</sql>
<select id="selectDmsBillsMaintInstanceList" parameterType="DmsBillsMaintInstance" resultMap="DmsBillsMaintInstanceResult">
<include refid="selectDmsBillsMaintInstanceVo"/>
<where>
<if test="planMaintId != null "> and plan_maint_id = #{planMaintId}</if>
<if test="maintInstanceId != null "> and maint_instance_id = #{maintInstanceId}</if>
<if test="wfProcessId != null "> and wf_process_id = #{wfProcessId}</if>
<if test="billsMaintCode != null and billsMaintCode != ''"> and bills_maint_code like concat('%',#{billsMaintCode},'%') </if>
<if test="planBeginTime != null "> and plan_begin_time > #{planBeginTime}</if>
<if test="planEndTime != null "> and #{planEndTime}>plan_end_time</if>
<if test="realBeginTime != null "> and real_begin_time > #{realBeginTime}</if>
<if test="realEndTime != null "> and #{realEndTime} > real_end_time</if>
<if test="maintStatus != null "> and maint_status = #{maintStatus}</if>
<if test="maintCompRate != null "> and maint_comp_rate = #{maintCompRate}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
<if test="planMaintId != null "> and a.plan_maint_id = #{planMaintId}</if>
<if test="maintInstanceId != null "> and a.maint_instance_id = #{maintInstanceId}</if>
<if test="wfProcessId != null "> and a.wf_process_id = #{wfProcessId}</if>
<if test="billsMaintCode != null and billsMaintCode != ''"> and a.bills_maint_code like concat('%',#{billsMaintCode},'%') </if>
<if test="planBeginTime != null "> and a.plan_begin_time > #{planBeginTime}</if>
<if test="planEndTime != null "> and #{planEndTime}>a.plan_end_time</if>
<if test="realBeginTime != null "> and a.real_begin_time > #{realBeginTime}</if>
<if test="realEndTime != null "> and #{realEndTime} > a.real_end_time</if>
<if test="maintStatus != null "> and a.maint_status = #{maintStatus}</if>
<if test="maintCompRate != null "> and a.maint_comp_rate = #{maintCompRate}</if>
<if test="isFlag != null "> and a.is_flag = #{isFlag}</if>
</where>
</select>

@ -138,13 +138,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectDmsPlanMaintDetailListByPlanMaintId" parameterType="Long" resultMap="DmsPlanMaintDetailResult">
select a.plan_maint_detail_id, a.plan_maint_id, a.device_id, a.maint_station_id,
a.maint_standard_id, a.operation_description,b.device_name,c.maint_station_name,d.maint_protocol
from dms_plan_maint_detail a
left join dms_base_device_ledger b on a.device_id = b.device_id
left join dms_base_maint_station c on b.device_type_id = c.device_type_id
left join dms_base_maint_standard d on a.maint_station_id = d.maint_standard_id
where a.plan_maint_id = #{planMaintId}
select
a.plan_maint_detail_id,
a.plan_maint_id,
a.device_id,
a.maint_station_id,
a.maint_standard_id,
a.operation_description,
b.device_name,
c.maint_station_code,
d.maint_protocol
from
dms_plan_maint_detail a
left join dms_base_device_ledger b on
a.device_id = b.device_id
left join dms_base_maint_station c on
a.maint_station_id = c.maint_station_id
left join dms_base_maint_standard d on
a.maint_standard_id = d.maint_standard_id
where
a.plan_maint_id = #{planMaintId}
</select>
<select id="selectStationIdByCode" resultType="java.lang.Long" parameterType="java.lang.String">
SELECT x.maint_station_id FROM `hwjy-cloud`.dms_base_maint_station x where x.maint_station_code = #{maintStationCode}

Loading…
Cancel
Save