点检-巡检-保养-检查项优化

highway
wws 1 year ago
parent eef550d5ae
commit 20efabdfd1

@ -77,4 +77,11 @@ public interface EquPlanDetailMapper {
* @param planCode * @param planCode
*/ */
void delEquPlanDetailByPlanCode(String planCode); void delEquPlanDetailByPlanCode(String planCode);
/**
* parentCode
* @param code
* @return
*/
List<EquPlanDetail> selectEquPlanDetailListByParentCode(String code);
} }

@ -64,4 +64,10 @@ public interface EquPlanEquSpareMapper {
* @param planCode * @param planCode
*/ */
void deleteEquPlanEquSpareByPlanCode(String planCode); void deleteEquPlanEquSpareByPlanCode(String planCode);
/**
*
* @param planCode
*/
void delEquPlanEquSpareByPlanCode(String planCode);
} }

@ -77,4 +77,11 @@ public interface EquPlanStandardMapper {
* @param planCode * @param planCode
*/ */
void delEquPlanStandardByPlanCode(String planCode); void delEquPlanStandardByPlanCode(String planCode);
/**
* parentCode
* @param code
* @return
*/
List<EquPlanStandard> selectEquPlanStandardListByParentCode(String code);
} }

@ -59,7 +59,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
/** /**
* list * list-
* *
* @return * @return
*/ */
@ -145,7 +145,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult updateInspectionRecord(EquOrder equOrder) { public AjaxResult updateInspectionRecord(EquOrder equOrder) {
boolean checkRepair = false; boolean hasError = false;
EquOrderEqu equ = equOrder.getEqu(); EquOrderEqu equ = equOrder.getEqu();
List<EquOrderDetail> detailList = equ.getDetailList(); List<EquOrderDetail> detailList = equ.getDetailList();
@ -176,12 +176,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
int up = standard.getActualValue().compareTo(standard.getDetailUpLimit()); int up = standard.getActualValue().compareTo(standard.getDetailUpLimit());
int down = standard.getActualValue().compareTo(standard.getDetailDownLimit()); int down = standard.getActualValue().compareTo(standard.getDetailDownLimit());
if (!(up != 1 && down != -1)) { if (!(up != 1 && down != -1)) {
checkRepair = true; hasError = true;
} }
}else { }else {
// 未达标 // TODO 未达标
if (standard.getDetailReach().equals("1")) { if (standard.getDetailReach().equals("1")) {
checkRepair = true; hasError = true;
} }
} }
@ -198,7 +198,17 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equOrder.setPlanPerson(SecurityContextHolder.getUserName()); equOrder.setPlanPerson(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName()); equOrder.setPlanPerson(SecurityContextHolder.getUserName());
if (checkRepair) { boolean checkRepair = false;
if (equOrder.getRepairCode() == null){
checkRepair = true;
}else {
if (equOrder.getRepairCode().isEmpty()){
checkRepair = true;
}
}
if (checkRepair && hasError) {
// 获取故障报修流水号 // 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder(); EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber()); String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
@ -213,6 +223,16 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equRepairOrder.setCreateTime(DateUtils.getNowDate()); equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername()); equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderStatus("待审核"); equRepairOrder.setOrderStatus("待审核");
// 报修来源
if (equOrder.getPlanType().equals("inspection")){
equRepairOrder.setOrderSource("巡检");
}
if (equOrder.getPlanType().equals("spotInspection")){
equRepairOrder.setOrderSource("点检");
}
if (equOrder.getPlanType().equals("maintenance")){
equRepairOrder.setOrderSource("保养");
}
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName"; String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
@ -221,7 +241,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
// 更新工单信息 // 更新工单信息
equOrderMapper.updateEquOrder(equOrder); equOrderMapper.updateEquOrder(equOrder);
return success(equOrder); return success();
} }
//////////////////////报修 //////////////////////报修

@ -6,14 +6,22 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.context.SecurityContextHolder; import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.*; import com.op.device.domain.*;
import com.op.device.mapper.*; import com.op.device.mapper.*;
import com.op.system.api.domain.SysUser; import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.op.device.service.IEquOrderService; import com.op.device.service.IEquOrderService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import static com.op.common.core.web.domain.AjaxResult.success; import static com.op.common.core.web.domain.AjaxResult.success;
@ -39,6 +47,8 @@ public class EquOrderServiceImpl implements IEquOrderService {
private PersonMapper personMapper; private PersonMapper personMapper;
@Autowired @Autowired
private EquOrderEquSpareMapper equOrderEquSpareMapper; private EquOrderEquSpareMapper equOrderEquSpareMapper;
@Autowired
private EquRepairOrderMapper equRepairOrderMapper;
/** /**
* *
@ -125,25 +135,102 @@ public class EquOrderServiceImpl implements IEquOrderService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult updateEquOrder(EquOrder equOrder) { public AjaxResult updateEquOrder(EquOrder equOrder) {
// 更新工单信息 boolean hasError = false;
equOrder.setOrderStart(equOrder.getTimeArray().get(0));
equOrder.setOrderEnd(equOrder.getTimeArray().get(1));
equOrder.setUpdateTime(DateUtils.getNowDate());
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName());
equOrderMapper.updateEquOrder(equOrder);
// 更新标准信息
EquOrderEqu equ = equOrder.getEqu(); EquOrderEqu equ = equOrder.getEqu();
List<EquOrderDetail> detailList = equ.getDetailList(); List<EquOrderDetail> detailList = equ.getDetailList();
for (EquOrderDetail detail : detailList) { for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = detail.getStandardList(); List<EquOrderStandard> standardList = detail.getStandardList();
for (EquOrderStandard standard : standardList) { for (EquOrderStandard standard : standardList) {
standard.setUpdateBy(SecurityContextHolder.getUserName());
//上传附件
if (StringUtils.isNotEmpty(standard.getPicturePath())) {
String[] ids = standard.getPicturePath().split(",");
List<BaseFileData> files = new ArrayList<>();
BaseFileData file = null;
for (String id : ids) {
file = new BaseFileData();
file.setFileId(IdUtils.fastSimpleUUID());
file.setFileName(id.split("&fileName=")[1]);
file.setFileAddress(id);
file.setSourceId(standard.getId());
file.setCreateBy(SecurityUtils.getUsername());
file.setCreateTime(new Date());
files.add(file);
}
equOrderStandardMapper.insertBaseFileBatch(files);
}
// 校验标准信息-是否申请报修
if (standard.getStandardType().equals("quantify")) {
int up = standard.getActualValue().compareTo(standard.getDetailUpLimit());
int down = standard.getActualValue().compareTo(standard.getDetailDownLimit());
if (!(up != 1 && down != -1)) {
hasError = true;
}
}else {
// TODO 未达标
if (standard.getDetailReach().equals("1")) {
hasError = true;
}
}
// 更新标准
standard.setUpdateTime(DateUtils.getNowDate()); standard.setUpdateTime(DateUtils.getNowDate());
equOrderStandardMapper.updateEquOrderStandard(standard); equOrderStandardMapper.updateEquOrderStandard(standard);
} }
} }
// 更新工单信息
equOrder.setOrderStatus("1"); // 状态为已完成
equOrder.setUpdateTime(DateUtils.getNowDate());
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName());
equOrder.setPlanPerson(SecurityContextHolder.getUserName());
boolean checkRepair = false;
if (equOrder.getRepairCode() == null){
checkRepair = true;
}else {
if (equOrder.getRepairCode().isEmpty()){
checkRepair = true;
}
}
if (checkRepair && hasError ) {
// 获取故障报修流水号
EquRepairOrder equRepairOrder = new EquRepairOrder();
String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equOrder.getEquipmentCode();
//报修单号
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
//在主表中存入报修单号信息
equOrder.setRepairCode(equRepairOrder.getOrderCode());
//新增报修记录
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
// 报修来源
if (equOrder.getPlanType().equals("inspection")){
equRepairOrder.setOrderSource("巡检");
}
if (equOrder.getPlanType().equals("spotInspection")){
equRepairOrder.setOrderSource("点检");
}
if (equOrder.getPlanType().equals("maintenance")){
equRepairOrder.setOrderSource("保养");
}
equRepairOrder.setOrderStatus("待审核");
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
}
// 更新工单信息
equOrderMapper.updateEquOrder(equOrder);
return success(); return success();
} }

@ -202,6 +202,8 @@ public class EquPlanServiceImpl implements IEquPlanService {
equPlanDetailMapper.delEquPlanDetailByPlanCode(equPlan.getPlanCode()); equPlanDetailMapper.delEquPlanDetailByPlanCode(equPlan.getPlanCode());
equPlanEquMapper.delEquPlanEquByPlanCode(equPlan.getPlanCode()); equPlanEquMapper.delEquPlanEquByPlanCode(equPlan.getPlanCode());
equPlanStandardMapper.delEquPlanStandardByPlanCode(equPlan.getPlanCode()); equPlanStandardMapper.delEquPlanStandardByPlanCode(equPlan.getPlanCode());
// TODO 有问题没有删除成功
equPlanEquSpareMapper.delEquPlanEquSpareByPlanCode(equPlan.getPlanCode());
} }
return success(); return success();
} }
@ -343,16 +345,10 @@ public class EquPlanServiceImpl implements IEquPlanService {
for (EquPlanEqu equipment : equipmentList) { for (EquPlanEqu equipment : equipmentList) {
// 获取检查项list // 获取检查项list
EquPlanDetail selectDetail = new EquPlanDetail(); List<EquPlanDetail> detailList = equPlanDetailMapper.selectEquPlanDetailListByParentCode(equipment.getCode());
selectDetail.setParentCode(equipment.getCode());
selectDetail.setPlanCode(equPlan.getPlanCode());
List<EquPlanDetail> detailList = equPlanDetailMapper.selectEquPlanDetailList(selectDetail);
for (EquPlanDetail detail : detailList) { for (EquPlanDetail detail : detailList) {
// 获取标准list // 获取标准list
EquPlanStandard selectStandard = new EquPlanStandard(); List<EquPlanStandard> standardList = equPlanStandardMapper.selectEquPlanStandardListByParentCode(detail.getCode());
selectStandard.setParentCode(detail.getCode());
selectStandard.setPlanCode(equPlan.getPlanCode());
List<EquPlanStandard> standardList = equPlanStandardMapper.selectEquPlanStandardList(selectStandard);
for (EquPlanStandard standard : standardList) { for (EquPlanStandard standard : standardList) {
standard.setShowFlag(true); standard.setShowFlag(true);
} }
@ -433,7 +429,7 @@ public class EquPlanServiceImpl implements IEquPlanService {
if (item != null) { if (item != null) {
item.setId(IdUtils.fastSimpleUUID()); item.setId(IdUtils.fastSimpleUUID());
item.setPlanCode(equPlan.getPlanCode()); item.setPlanCode(equPlan.getPlanCode());
item.setCode("C" + equPlan.getPlanCode() + String.format("%02d", ++itemCodeTemp)); item.setCode("C" + equipment.getCode() + String.format("%02d", ++itemCodeTemp));
item.setParentCode(equipment.getCode()); item.setParentCode(equipment.getCode());
item.setCreateBy(SecurityContextHolder.getUserName()); item.setCreateBy(SecurityContextHolder.getUserName());
item.setCreateTime(DateUtils.getNowDate()); item.setCreateTime(DateUtils.getNowDate());
@ -458,7 +454,7 @@ public class EquPlanServiceImpl implements IEquPlanService {
standard.setId(IdUtils.fastSimpleUUID()); standard.setId(IdUtils.fastSimpleUUID());
standard.setParentCode(item.getCode()); standard.setParentCode(item.getCode());
standard.setPlanCode(equPlan.getPlanCode()); standard.setPlanCode(equPlan.getPlanCode());
standard.setCode("D" + equPlan.getPlanCode() + String.format("%02d", ++detailCodeTemp)); standard.setCode("D" + item.getCode() + String.format("%02d", ++detailCodeTemp));
standard.setCreateBy(SecurityContextHolder.getUserName()); standard.setCreateBy(SecurityContextHolder.getUserName());
standard.setCreateTime(DateUtils.getNowDate()); standard.setCreateTime(DateUtils.getNowDate());
standard.setUpdateBy(SecurityContextHolder.getUserName()); standard.setUpdateBy(SecurityContextHolder.getUserName());

@ -209,24 +209,6 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult updateEquOrder(EquOrder equOrder) { public AjaxResult updateEquOrder(EquOrder equOrder) {
// 更新保养工单信息
equOrder.setOrderStart(equOrder.getTimeArray().get(0));
equOrder.setOrderEnd(equOrder.getTimeArray().get(1));
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setUpdateTime(DateUtils.getNowDate());
equOrderMapper.updateEquOrder(equOrder);
// 更新标准信息
EquOrderEqu equ = equOrder.getEqu();
List<EquOrderDetail> detailList = equ.getDetailList();
for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = detail.getStandardList();
for (EquOrderStandard standard : standardList) {
standard.setUpdateBy(SecurityContextHolder.getUserName());
standard.setUpdateTime(DateUtils.getNowDate());
equOrderStandardMapper.updateEquOrderStandard(standard);
}
}
return success(); return success();
} }

@ -265,7 +265,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
if (item != null) { if (item != null) {
item.setId(IdUtils.fastSimpleUUID()); item.setId(IdUtils.fastSimpleUUID());
item.setPlanCode(equPlan.getPlanCode()); item.setPlanCode(equPlan.getPlanCode());
item.setCode("C" + equPlan.getPlanCode() + String.format("%02d", ++itemCodeTemp)); item.setCode("C" + equipment.getCode() + String.format("%02d", ++itemCodeTemp));
item.setParentCode(equipment.getCode()); item.setParentCode(equipment.getCode());
item.setCreateBy(SecurityContextHolder.getUserName()); item.setCreateBy(SecurityContextHolder.getUserName());
item.setCreateTime(DateUtils.getNowDate()); item.setCreateTime(DateUtils.getNowDate());
@ -290,7 +290,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
standard.setId(IdUtils.fastSimpleUUID()); standard.setId(IdUtils.fastSimpleUUID());
standard.setParentCode(item.getCode()); standard.setParentCode(item.getCode());
standard.setPlanCode(equPlan.getPlanCode()); standard.setPlanCode(equPlan.getPlanCode());
standard.setCode("D" + equPlan.getPlanCode() + String.format("%02d", ++detailCodeTemp)); standard.setCode("D" + item.getCode() + String.format("%02d", ++detailCodeTemp));
standard.setCreateBy(SecurityContextHolder.getUserName()); standard.setCreateBy(SecurityContextHolder.getUserName());
standard.setCreateTime(DateUtils.getNowDate()); standard.setCreateTime(DateUtils.getNowDate());
standard.setUpdateBy(SecurityContextHolder.getUserName()); standard.setUpdateBy(SecurityContextHolder.getUserName());

@ -44,22 +44,23 @@
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
and del_flag = '0'
</where> </where>
</select> </select>
<select id="selectEquOrderDetailById" parameterType="String" resultMap="EquOrderDetailResult"> <select id="selectEquOrderDetailById" parameterType="String" resultMap="EquOrderDetailResult">
<include refid="selectEquOrderDetailVo"/> <include refid="selectEquOrderDetailVo"/>
where id = #{id} where id = #{id} and del_flag = '0'
</select> </select>
<select id="selectEquOrderDetailByParentCode" parameterType="String" resultMap="EquOrderDetailResult"> <select id="selectEquOrderDetailByParentCode" parameterType="String" resultMap="EquOrderDetailResult">
<include refid="selectEquOrderDetailVo"/> <include refid="selectEquOrderDetailVo"/>
where parent_code = #{parentCode} where parent_code = #{parentCode} and del_flag = '0'
</select> </select>
<select id="selectEquOrderDetailByOrderCode" parameterType="String" resultMap="EquOrderDetailResult"> <select id="selectEquOrderDetailByOrderCode" parameterType="String" resultMap="EquOrderDetailResult">
<include refid="selectEquOrderDetailVo"/> <include refid="selectEquOrderDetailVo"/>
where order_code = #{orderCode} where order_code = #{orderCode} and del_flag = '0'
</select> </select>
<insert id="insertEquOrderDetail" parameterType="EquOrderDetail"> <insert id="insertEquOrderDetail" parameterType="EquOrderDetail">

@ -38,17 +38,18 @@
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
and del_flag = '0'
</where> </where>
</select> </select>
<select id="selectEquOrderEquById" parameterType="String" resultMap="EquOrderEquResult"> <select id="selectEquOrderEquById" parameterType="String" resultMap="EquOrderEquResult">
<include refid="selectEquOrderEquVo"/> <include refid="selectEquOrderEquVo"/>
where id = #{id} where id = #{id} and del_flag = '0'
</select> </select>
<select id="selectEquOrderEquListByParentCode" parameterType="String" resultMap="EquOrderEquResult"> <select id="selectEquOrderEquListByParentCode" parameterType="String" resultMap="EquOrderEquResult">
<include refid="selectEquOrderEquVo"/> <include refid="selectEquOrderEquVo"/>
where parent_code = #{parentCode} where parent_code = #{parentCode} and del_flag = '0'
</select> </select>
<insert id="insertEquOrderEqu" parameterType="EquOrderEqu"> <insert id="insertEquOrderEqu" parameterType="EquOrderEqu">
@ -107,7 +108,7 @@
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
</trim> </trim>
where id = #{id} where id = #{id} and del_flag = '0'
</update> </update>
<delete id="deleteEquOrderEquById" parameterType="String"> <delete id="deleteEquOrderEquById" parameterType="String">

@ -42,22 +42,23 @@
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
and del_flag = '0'
</where> </where>
</select> </select>
<select id="selectEquOrderEquSpareById" parameterType="String" resultMap="EquOrderEquSpareResult"> <select id="selectEquOrderEquSpareById" parameterType="String" resultMap="EquOrderEquSpareResult">
<include refid="selectEquOrderEquSpareVo"/> <include refid="selectEquOrderEquSpareVo"/>
where id = #{id} where id = #{id} and del_flag = '0'
</select> </select>
<select id="selectEquOrderEquSpareByParentCode" parameterType="String" resultMap="EquOrderEquSpareResult"> <select id="selectEquOrderEquSpareByParentCode" parameterType="String" resultMap="EquOrderEquSpareResult">
<include refid="selectEquOrderEquSpareVo"/> <include refid="selectEquOrderEquSpareVo"/>
where parent_code = #{parentCode} where parent_code = #{parentCode} and del_flag = '0'
</select> </select>
<select id="selectEquOrderEquSpareByOrderCode" parameterType="String" resultMap="EquOrderEquSpareResult"> <select id="selectEquOrderEquSpareByOrderCode" parameterType="String" resultMap="EquOrderEquSpareResult">
<include refid="selectEquOrderEquSpareVo"/> <include refid="selectEquOrderEquSpareVo"/>
where order_code = #{orderCode} where order_code = #{orderCode} and del_flag = '0'
</select> </select>
<insert id="insertEquOrderEquSpare" parameterType="EquOrderEquSpare"> <insert id="insertEquOrderEquSpare" parameterType="EquOrderEquSpare">
@ -122,7 +123,7 @@
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
</trim> </trim>
where id = #{id} where id = #{id} and del_flag = '0'
</update> </update>
<delete id="deleteEquOrderEquSpareById" parameterType="String"> <delete id="deleteEquOrderEquSpareById" parameterType="String">

@ -85,7 +85,7 @@
<select id="selectEquOrderByOrderCode" parameterType="String" resultMap="EquOrderResult"> <select id="selectEquOrderByOrderCode" parameterType="String" resultMap="EquOrderResult">
<include refid="selectEquOrderVo"/> <include refid="selectEquOrderVo"/>
where order_code = #{orderCode} where order_code = #{orderCode} and del_flag = '0'
</select> </select>
<select id="selectPlanNameByPlanCode" resultType="java.lang.String"> <select id="selectPlanNameByPlanCode" resultType="java.lang.String">
@ -112,7 +112,7 @@
<select id="selectEquOrderByOrderId" parameterType="String" resultMap="EquOrderResult"> <select id="selectEquOrderByOrderId" parameterType="String" resultMap="EquOrderResult">
<include refid="selectEquOrderVo"/> <include refid="selectEquOrderVo"/>
where order_id = #{orderId} where order_id = #{orderId} and del_flag = '0'
</select> </select>
<select id="selectSerialNumber" resultType="java.lang.Integer"> <select id="selectSerialNumber" resultType="java.lang.Integer">

@ -34,16 +34,17 @@
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
and del_flag = '0'
</where> </where>
</select> </select>
<select id="selectEquOrderPersonById" parameterType="String" resultMap="EquOrderPersonResult"> <select id="selectEquOrderPersonById" parameterType="String" resultMap="EquOrderPersonResult">
<include refid="selectEquOrderPersonVo"/> <include refid="selectEquOrderPersonVo"/>
where id = #{id} where id = #{id} and del_flag = '0'
</select> </select>
<select id="selectEquOrderPersonByOrderCode" resultType="java.lang.String"> <select id="selectEquOrderPersonByOrderCode" resultType="java.lang.String">
SELECT user_id FROM equ_order_person where order_code = #{orderCode} SELECT user_id FROM equ_order_person where order_code = #{orderCode} and del_flag = '0'
</select> </select>
<insert id="insertEquOrderPerson" parameterType="EquOrderPerson"> <insert id="insertEquOrderPerson" parameterType="EquOrderPerson">
@ -96,7 +97,7 @@
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
</trim> </trim>
where id = #{id} where id = #{id} and del_flag = '0'
</update> </update>
<delete id="deleteEquOrderPersonById" parameterType="String"> <delete id="deleteEquOrderPersonById" parameterType="String">

@ -62,17 +62,18 @@
<if test="repairReach != null and repairReach != ''"> and repair_reach = #{repairReach}</if> <if test="repairReach != null and repairReach != ''"> and repair_reach = #{repairReach}</if>
<if test="repairValue != null and repairValue != ''"> and repair_value = #{repairValue}</if> <if test="repairValue != null and repairValue != ''"> and repair_value = #{repairValue}</if>
<if test="repairPicture != null and repairPicture != ''"> and repair_picture = #{repairPicture}</if> <if test="repairPicture != null and repairPicture != ''"> and repair_picture = #{repairPicture}</if>
and del_flag = '0'
</where> </where>
</select> </select>
<select id="selectEquOrderStandardById" parameterType="String" resultMap="EquOrderStandardResult"> <select id="selectEquOrderStandardById" parameterType="String" resultMap="EquOrderStandardResult">
<include refid="selectEquOrderStandardVo"/> <include refid="selectEquOrderStandardVo"/>
where id = #{id} where id = #{id} and del_flag = '0'
</select> </select>
<select id="selectEquOrderStandardByParentCode" parameterType="String" resultMap="EquOrderStandardResult"> <select id="selectEquOrderStandardByParentCode" parameterType="String" resultMap="EquOrderStandardResult">
<include refid="selectEquOrderStandardVo"/> <include refid="selectEquOrderStandardVo"/>
where parent_code = #{parentCode} where parent_code = #{parentCode} and del_flag = '0'
</select> </select>
<insert id="insertEquOrderStandard" parameterType="EquOrderStandard"> <insert id="insertEquOrderStandard" parameterType="EquOrderStandard">
@ -183,7 +184,7 @@
<if test="repairValue != null">repair_value = #{repairValue},</if> <if test="repairValue != null">repair_value = #{repairValue},</if>
<if test="repairPicture != null">repair_picture = #{repairPicture},</if> <if test="repairPicture != null">repair_picture = #{repairPicture},</if>
</trim> </trim>
where id = #{id} where id = #{id} and del_flag = '0'
</update> </update>
<delete id="deleteEquOrderStandardById" parameterType="String"> <delete id="deleteEquOrderStandardById" parameterType="String">

@ -48,17 +48,24 @@
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
and del_flag = '0'
</where> </where>
ORDER BY item_name
</select> </select>
<select id="selectEquPlanDetailById" parameterType="String" resultMap="EquPlanDetailResult"> <select id="selectEquPlanDetailById" parameterType="String" resultMap="EquPlanDetailResult">
<include refid="selectEquPlanDetailVo"/> <include refid="selectEquPlanDetailVo"/>
where id = #{id} where id = #{id} and del_flag = '0'
</select> </select>
<select id="selectEquPlanDetailByPlanCode" parameterType="String" resultMap="EquPlanDetailResult"> <select id="selectEquPlanDetailByPlanCode" parameterType="String" resultMap="EquPlanDetailResult">
<include refid="selectEquPlanDetailVo"/> <include refid="selectEquPlanDetailVo"/>
where plan_code = #{planCode} and del_flag = '0' where plan_code = #{planCode} and del_flag = '0' ORDER BY item_name
</select>
<select id="selectEquPlanDetailListByParentCode" parameterType="String" resultMap="EquPlanDetailResult">
<include refid="selectEquPlanDetailVo"/>
where parent_code = #{code} and del_flag = '0' ORDER BY item_name
</select> </select>
<insert id="insertEquPlanDetail" parameterType="EquPlanDetail"> <insert id="insertEquPlanDetail" parameterType="EquPlanDetail">
@ -132,7 +139,7 @@
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
</trim> </trim>
where id = #{id} where id = #{id} and del_flag = '0'
</update> </update>
<delete id="deleteEquPlanDetailById" parameterType="String"> <delete id="deleteEquPlanDetailById" parameterType="String">

@ -108,7 +108,7 @@
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
</trim> </trim>
where id = #{id} where id = #{id} and del_flag = '0'
</update> </update>
<delete id="deleteEquPlanEquById" parameterType="String"> <delete id="deleteEquPlanEquById" parameterType="String">

@ -129,4 +129,9 @@
<delete id="deleteEquPlanEquSpareByPlanCode"> <delete id="deleteEquPlanEquSpareByPlanCode">
delete from equ_plan_equ_spare where plan_code = #{planCode} delete from equ_plan_equ_spare where plan_code = #{planCode}
</delete> </delete>
<delete id="delEquPlanEquSpareByPlanCode">
update equ_plan_equ_spare set del_flag = '1' where plan_code = #{planCode} and del_flag = '0'
</delete>
</mapper> </mapper>

@ -48,6 +48,7 @@
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
and del_flag = '0' and del_flag = '0'
</where> </where>
ORDER BY standard_name
</select> </select>
<select id="selectEquPlanStandardById" parameterType="String" resultMap="EquPlanStandardResult"> <select id="selectEquPlanStandardById" parameterType="String" resultMap="EquPlanStandardResult">
@ -57,7 +58,12 @@
<select id="selectEquPlanStandardByPlanCode" parameterType="String" resultMap="EquPlanStandardResult"> <select id="selectEquPlanStandardByPlanCode" parameterType="String" resultMap="EquPlanStandardResult">
<include refid="selectEquPlanStandardVo"/> <include refid="selectEquPlanStandardVo"/>
where plan_code = #{planCode} and del_flag ='0' where plan_code = #{planCode} and del_flag ='0' ORDER BY standard_name
</select>
<select id="selectEquPlanStandardListByParentCode" parameterType="String" resultMap="EquPlanStandardResult">
<include refid="selectEquPlanStandardVo"/>
where parent_code = #{code} and del_flag ='0' ORDER BY standard_name
</select> </select>
<insert id="insertEquPlanStandard" parameterType="EquPlanStandard"> <insert id="insertEquPlanStandard" parameterType="EquPlanStandard">

Loading…
Cancel
Save