报修+维修+设备班组

highway
A0010407 1 year ago
parent 551e194707
commit 9bb46f6a5e

@ -129,10 +129,10 @@ public class EquRepairOrderController extends BaseController {
/**
*
*/
@GetMapping("/getPersonList")
public TableDataInfo getPersonList(EquEquipment equEquipment) {
@GetMapping("/getRepairPersonList")
public TableDataInfo getRepairPersonList(EquEquipment equEquipment) {
startPage();
List<EquEquipment> list = equRepairOrderService.getPersonList(equEquipment);
List<EquEquipment> list = equRepairOrderService.getRepairPersonList(equEquipment);
return getDataTable(list);
}

@ -3,6 +3,7 @@ package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.service.IEquOutsourceWorkService;
import org.springframework.beans.factory.annotation.Autowired;
@ -109,4 +110,22 @@ public class EquRepairWorkOrderController extends BaseController {
public AjaxResult apply(@RequestBody EquOutsourceWork equOutsourceWork) {
return toAjax(equOutsourceWorkService.insertEquOutsourceWork(equOutsourceWork));
}
/**
*
*/
@RequiresPermissions("device:repairOrder:write")
@PostMapping("/write")
public AjaxResult write(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
equRepairWorkOrder.setWorkCost(equRepairWorkOrder.getWorkCost()+"元");
return toAjax(equRepairWorkOrderService.updateEquRepairWorkOrder(equRepairWorkOrder));
}
//获取维修人员列表
@GetMapping("/getMaintenancePersonList")
public TableDataInfo getMaintenancePersonList(EquEquipment equEquipment) {
startPage();
List<EquEquipment> list = equRepairWorkOrderService.getMaintenancePersonList(equEquipment);
return getDataTable(list);
}
}

@ -0,0 +1,97 @@
package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.device.domain.EquTeam;
import com.op.device.service.IEquTeamService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2023-11-01
*/
@RestController
@RequestMapping("/equTeam")
public class EquTeamController extends BaseController {
@Autowired
private IEquTeamService equTeamService;
/**
*
*/
@RequiresPermissions("device:equTeam:list")
@GetMapping("/list")
public TableDataInfo list(EquTeam equTeam) {
startPage();
List<EquTeam> list = equTeamService.selectEquTeamList(equTeam);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:equTeam:export")
@Log(title = "设备班组维护", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquTeam equTeam) {
List<EquTeam> list = equTeamService.selectEquTeamList(equTeam);
ExcelUtil<EquTeam> util = new ExcelUtil<EquTeam>(EquTeam.class);
util.exportExcel(response, list, "设备班组维护数据");
}
/**
*
*/
@RequiresPermissions("device:equTeam:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return success(equTeamService.selectEquTeamById(id));
}
/**
*
*/
@RequiresPermissions("device:equTeam:add")
@Log(title = "设备班组维护", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquTeam equTeam) {
return toAjax(equTeamService.insertEquTeam(equTeam));
}
/**
*
*/
@RequiresPermissions("device:equTeam:edit")
@Log(title = "设备班组维护", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquTeam equTeam) {
return toAjax(equTeamService.updateEquTeam(equTeam));
}
/**
*
*/
@RequiresPermissions("device:equTeam:remove")
@Log(title = "设备班组维护", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(equTeamService.deleteEquTeamByIds(ids));
}
}

@ -41,34 +41,42 @@ public class EquPerson extends BaseEntity {
@Excel(name = "人员拼接名字")
private String teamUserName;
/** 人员部门编码 */
@Excel(name = "人员部门编码")
private String postCode;
/** 人员部门名称 */
@Excel(name = "人员部门名称")
private String postName;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public String getTeamId() {
return teamId;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamCode() {
return teamCode;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
public void setUserName(String userName) {
this.userName = userName;
}
@ -90,6 +98,22 @@ public class EquPerson extends BaseEntity {
this.teamUserName = teamUserName;
}
public void setPostCode(String postCode) {
this.postCode = postCode;
}
public String getPostCode() {
return postCode;
}
public void setPostName(String postName) {
this.postName = postName;
}
public String getPostName() {
return postName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -84,6 +84,7 @@ public class EquRepairOrder extends BaseEntity {
/** 删除标志 */
private String delFlag;
//设备
/** 设备类型名称 */
@Excel(name = "设备类型名称")
private String equipmentTypeName;
@ -405,7 +406,6 @@ public class EquRepairOrder extends BaseEntity {
public void setWorkDownMachine(String workDownMachine) {
this.workDownMachine = workDownMachine;
}
public String getWorkDownMachine() {
return workDownMachine;
}

@ -117,6 +117,21 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "工厂编码")
private String factoryCode;
/** 维修状态 */
@Excel(name = "维修状态")
private String workStatus;
/** 维修开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private String workStartTime;
/** 维修结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private String workEndTime;
// 设备
/** 设备名称 */
@Excel(name = "设备名称")
@ -139,6 +154,77 @@ public class EquRepairWorkOrder extends BaseEntity {
private String department;
//报修
/** 故障描述 */
@Excel(name = "故障描述")
private String orderDesc;
/** 故障时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "故障时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderBreakdownTime;
/** 报修来源 */
@Excel(name = "报修来源")
private String orderSource;
/** 报修时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "报修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderTime;
/** 报修人 */
@Excel(name = "报修人")
private String orderRepairman;
/** 联系方式 */
@Excel(name = "联系方式")
private String orderConnection;
//报修
public void setOrderDesc(String orderDesc) {
this.orderDesc = orderDesc;
}
public String getOrderDesc() {
return orderDesc;
}
public void setOrderBreakdownTime(Date orderBreakdownTime) {
this.orderBreakdownTime = orderBreakdownTime;
}
public Date getOrderBreakdownTime() {
return orderBreakdownTime;
}
public void setOrderSource(String orderSource) {
this.orderSource = orderSource;
}
public String getOrderSource() {
return orderSource;
}
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public Date getOrderTime() {
return orderTime;
}
public void setOrderRepairman(String orderRepairman) {
this.orderRepairman = orderRepairman;
}
public String getOrderRepairman() {
return orderRepairman;
}
public void setOrderConnection(String orderConnection) {
this.orderConnection = orderConnection;
}
public String getOrderConnection() {
return orderConnection;
}
//设备
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
@ -353,6 +439,32 @@ public class EquRepairWorkOrder extends BaseEntity {
return factoryCode;
}
//维修工单 新增字段 维修状态
public void setWorkStatus(String workStatus) {
this.workStatus = workStatus;
}
public String getWorkStatus() {
return workStatus;
}
//维修工单 新增字段 维修开始结束时间
public void setWorkStartTime(String workStartTime) {
this.workStartTime = workStartTime;
}
public String getWorkStartTime() {
return workStartTime;
}
public void setWorkEndTime(String workEndTime) {
this.workEndTime = workEndTime;
}
public String getWorkEndTime() {
return workEndTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,109 @@
package com.op.device.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* equ_team
*
* @author Open Platform
* @date 2023-11-01
*/
public class EquTeam extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 班组编号 */
@Excel(name = "班组编号")
private String teamCode;
/** 班组名称 */
@Excel(name = "班组名称")
private String teamName;
/** 班组类型 */
@Excel(name = "班组类型")
private String teamType;
/** 班组人员 */
@Excel(name = "班组人员")
private String teamPerson;
/** 删除标志 */
private String delFlag;
/** 工厂号 */
@Excel(name = "工厂号")
private String factoryCode;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamCode() {
return teamCode;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getTeamName() {
return teamName;
}
public void setTeamType(String teamType) {
this.teamType = teamType;
}
public String getTeamType() {
return teamType;
}
public void setTeamPerson(String teamPerson) {
this.teamPerson = teamPerson;
}
public String getTeamPerson() {
return teamPerson;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("teamCode", getTeamCode())
.append("teamName", getTeamName())
.append("teamType", getTeamType())
.append("teamPerson", getTeamPerson())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("delFlag", getDelFlag())
.append("factoryCode", getFactoryCode())
.toString();
}
}

@ -69,5 +69,5 @@ public interface EquRepairOrderMapper {
//查询报修人员列表
@DS("master")
List<EquEquipment> getPersonList(EquEquipment equEquipment);
List<EquEquipment> getRepairPersonList(EquEquipment equEquipment);
}

@ -2,6 +2,7 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquRepairWorkOrder;
/**
@ -64,4 +65,7 @@ public interface EquRepairWorkOrderMapper {
//转委外
void updateWorkOutsource(EquRepairWorkOrder equRepairWorkOrder);
//获取维修人员列表
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment);
}

@ -0,0 +1,61 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquTeam;
/**
* Mapper
*
* @author Open Platform
* @date 2023-11-01
*/
public interface EquTeamMapper {
/**
*
*
* @param id
* @return
*/
public EquTeam selectEquTeamById(String id);
/**
*
*
* @param equTeam
* @return
*/
public List<EquTeam> selectEquTeamList(EquTeam equTeam);
/**
*
*
* @param equTeam
* @return
*/
public int insertEquTeam(EquTeam equTeam);
/**
*
*
* @param equTeam
* @return
*/
public int updateEquTeam(EquTeam equTeam);
/**
*
*
* @param id
* @return
*/
public int deleteEquTeamById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteEquTeamByIds(String[] ids);
}

@ -77,5 +77,5 @@ public interface IEquRepairOrderService {
public int checkEquRepairOrder(EquRepairOrder equRepairOrder);
//查询报修人员列表
List<EquEquipment> getPersonList(EquEquipment equEquipment);
List<EquEquipment> getRepairPersonList(EquEquipment equEquipment);
}

@ -1,6 +1,8 @@
package com.op.device.service;
import java.util.List;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquRepairWorkOrder;
/**
@ -57,4 +59,7 @@ public interface IEquRepairWorkOrderService {
* @return
*/
public int deleteEquRepairWorkOrderByWorkId(String workId);
//获取维修人员列表
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment);
}

@ -0,0 +1,60 @@
package com.op.device.service;
import java.util.List;
import com.op.device.domain.EquTeam;
/**
* Service
*
* @author Open Platform
* @date 2023-11-01
*/
public interface IEquTeamService {
/**
*
*
* @param id
* @return
*/
public EquTeam selectEquTeamById(String id);
/**
*
*
* @param equTeam
* @return
*/
public List<EquTeam> selectEquTeamList(EquTeam equTeam);
/**
*
*
* @param equTeam
* @return
*/
public int insertEquTeam(EquTeam equTeam);
/**
*
*
* @param equTeam
* @return
*/
public int updateEquTeam(EquTeam equTeam);
/**
*
*
* @param ids
* @return
*/
public int deleteEquTeamByIds(String[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteEquTeamById(String id);
}

@ -114,6 +114,7 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
}else{
equRepairWorkOrder.setWorkDownMachine("0");
}
equRepairWorkOrder.setWorkFaultDesc(equRepairOrder.getOrderDesc());
equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
@ -214,7 +215,7 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
*/
@Override
@DS("#header.poolName")
public List<EquEquipment> getPersonList(EquEquipment equEquipment) {
return equRepairOrderMapper.getPersonList(equEquipment);
public List<EquEquipment> getRepairPersonList(EquEquipment equEquipment) {
return equRepairOrderMapper.getRepairPersonList(equEquipment);
}
}

@ -6,6 +6,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquEquipment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairWorkOrderMapper;
@ -103,4 +104,10 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
public int deleteEquRepairWorkOrderByWorkId(String workId) {
return equRepairWorkOrderMapper.deleteEquRepairWorkOrderByWorkId(workId);
}
//获取维人员列表
@Override
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment) {
return equRepairWorkOrderMapper.getMaintenancePersonList(equEquipment);
}
}

@ -0,0 +1,102 @@
package com.op.device.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquTeamMapper;
import com.op.device.domain.EquTeam;
import com.op.device.service.IEquTeamService;
/**
* Service
*
* @author Open Platform
* @date 2023-11-01
*/
@Service
public class EquTeamServiceImpl implements IEquTeamService {
@Autowired
private EquTeamMapper equTeamMapper;
/**
*
*
* @param id
* @return
*/
@Override
@DS("#header.poolName")
public EquTeam selectEquTeamById(String id) {
return equTeamMapper.selectEquTeamById(id);
}
/**
*
*
* @param equTeam
* @return
*/
@Override
@DS("#header.poolName")
public List<EquTeam> selectEquTeamList(EquTeam equTeam) {
return equTeamMapper.selectEquTeamList(equTeam);
}
/**
*
*
* @param equTeam
* @return
*/
@Override
@DS("#header.poolName")
public int insertEquTeam(EquTeam equTeam) {
equTeam.setId(IdUtils.fastSimpleUUID());
equTeam.setCreateTime(DateUtils.getNowDate());
equTeam.setCreateBy(SecurityUtils.getUsername());
return equTeamMapper.insertEquTeam(equTeam);
}
/**
*
*
* @param equTeam
* @return
*/
@Override
@DS("#header.poolName")
public int updateEquTeam(EquTeam equTeam) {
equTeam.setUpdateTime(DateUtils.getNowDate());
equTeam.setUpdateBy(SecurityUtils.getUsername());
return equTeamMapper.updateEquTeam(equTeam);
}
/**
*
*
* @param ids
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquTeamByIds(String[] ids) {
return equTeamMapper.deleteEquTeamByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquTeamById(String id) {
return equTeamMapper.deleteEquTeamById(id);
}
}

@ -215,7 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
</select>
<select id="getPersonList" parameterType="EquPerson" resultType="com.op.device.domain.EquPerson">
<select id="getRepairPersonList" parameterType="EquPerson" resultType="com.op.device.domain.EquPerson">
select
user_id AS userId,
user_name AS userName,

@ -5,10 +5,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.op.device.mapper.EquRepairWorkOrderMapper">
<resultMap type="EquRepairWorkOrder" id="EquRepairWorkOrderResult">
<!--维修工单-->
<result property="workId" column="work_id" />
<result property="orderId" column="order_id" />
<result property="workCode" column="work_code" />
<result property="orderCode" column="order_code" />
<result property="equipmentCode" column="equipment_code" />
<result property="workHandle" column="work_handle" />
<result property="workPlanTime" column="work_plan_time" />
<result property="workPlanDownTime" column="work_plan_down_time" />
@ -17,11 +19,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="workTeam" column="work_team" />
<result property="workOutsource" column="work_outsource" />
<result property="workDownMachine" column="work_down_machine" />
<result property="equipmentCode" column="equipment_code" />
<result property="workReason" column="work_reason" />
<result property="workFaultDesc" column="work_fault_desc" />
<result property="workStartTime" column="work_start_time" />
<result property="workEndTime" column="work_end_time" />
<result property="workCostTime" column="work_cost_time" />
<result property="workCost" column="work_cost" />
<result property="workStatus" column="work_status" />
<result property="outWorkId" column="out_work_id" />
<result property="outWorkCode" column="out_work_code" />
<result property="attr1" column="attr1" />
@ -39,34 +43,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="equipmentTypeName" column="equipment_type_name" />
<result property="equipmentLocation" column="equipment_location" />
<result property="department" column="department" />
<!--报修信息-->
<result property="orderDesc" column="order_desc" />
<result property="orderBreakdownTime" column="order_breakdown_time" />
<result property="orderSource" column="order_source" />
<result property="orderTime" column="order_time" />
<result property="orderRepairman" column="order_repairman" />
<result property="orderConnection" column="order_connection" />
</resultMap>
<sql id="selectEquRepairWorkOrderVo">
select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_cost_time, work_cost, out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code from equ_repair_work_order
select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_start_time,work_end_time,work_cost_time, work_cost, work_status,out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code from equ_repair_work_order
</sql>
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
<include refid="selectEquRepairWorkOrderVo"/>
<where>
<where>
<!--报修id 维修code 报修code-->
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</if>
<if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
<!--设备code 设备故障描述 计划维修时间 是否停机 计划停机时间-->
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if>
<if test="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if>
<if test="workPlanTime != null "> and work_plan_time = #{workPlanTime}</if>
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if>
<if test="workPlanDownTime != null "> and work_plan_down_time = #{workPlanDownTime}</if>
<!--维修人员 维修组-->
<if test="workPerson != null and workPerson != ''"> and work_person like concat('%', #{workPerson}, '%')</if>
<if test="workTeam != null and workTeam != ''"> and work_team like concat('%', #{workTeam}, '%')</if>
<!--是否委外 委外工单编码-->
<if test="workOutsource != null and workOutsource != ''"> and work_outsource = #{workOutsource}</if>
<if test="outWorkCode != null and outWorkCode != ''"> and out_work_code = #{outWorkCode}</if>
<!--没有用上-->
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</if>
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if>
<!--故障原因 维修开始时间 维修结束时间 花费时间 费用 维修状态 -->
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if>
<if test="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if>
<if test="workStartTime != null "> and work_start_time = #{workStartTime}</if>
<if test="workEndTime != null "> and work_end_time = #{workEndTime}</if>
<if test="workCostTime != null "> and work_cost_time = #{workCostTime}</if>
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
<if test="workStatus != null and workStatus != ''"> and work_status = #{workStatus}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<!--没有用上-->
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</if>
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if>
and del_flag = '0'
</where>
ORDER BY create_time DESC
@ -89,8 +108,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
erwo.equipment_code,
erwo.work_reason,
erwo.work_fault_desc,
erwo.work_start_time,
erwo.work_end_time,
erwo.work_cost_time,
erwo.work_cost,
erwo.work_status,
erwo.out_work_id,
erwo.out_work_code,
erwo.attr1,
@ -105,9 +127,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
be.equipment_spec,
be.equipment_type_name,
be.equipment_location,
be.department
be.department,
ero.order_desc,
ero.order_breakdown_time,
ero.order_source,
ero.order_time,
ero.order_repairman,
ero.order_connection
from equ_repair_work_order erwo
left join base_equipment be on erwo.equipment_code = be.equipment_code
left join equ_repair_order ero on erwo.order_code = ero.order_code
where erwo.work_id = #{workId}
and erwo.del_flag = '0'
ORDER BY create_time DESC
@ -131,8 +160,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="equipmentCode != null">equipment_code,</if>
<if test="workReason != null">work_reason,</if>
<if test="workFaultDesc != null">work_fault_desc,</if>
<if test="workStartTime != null">work_start_time,</if>
<if test="workEndTime != null">work_end_time,</if>
<if test="workCostTime != null">work_cost_time,</if>
<if test="workCost != null">work_cost,</if>
<if test="workStatus != null">work_status,</if>
<if test="outWorkId != null">out_work_id,</if>
<if test="outWorkCode != null">out_work_code,</if>
<if test="attr1 != null">attr1,</if>
@ -161,8 +193,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="equipmentCode != null">#{equipmentCode},</if>
<if test="workReason != null">#{workReason},</if>
<if test="workFaultDesc != null">#{workFaultDesc},</if>
<if test="workStartTime != null">#{workStartTime},</if>
<if test="workEndTime != null">#{workEndTime},</if>
<if test="workCostTime != null">#{workCostTime},</if>
<if test="workCost != null">#{workCost},</if>
<if test="workStatus != null">#{workStatus},</if>
<if test="outWorkId != null">#{outWorkId},</if>
<if test="outWorkCode != null">#{outWorkCode},</if>
<if test="attr1 != null">#{attr1},</if>
@ -194,8 +229,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
<if test="workReason != null">work_reason = #{workReason},</if>
<if test="workFaultDesc != null">work_fault_desc = #{workFaultDesc},</if>
<if test="workStartTime != null">work_start_time = #{workStartTime},</if>
<if test="workEndTime != null">work_end_time = #{workEndTime},</if>
<if test="workCostTime != null">work_cost_time = #{workCostTime},</if>
<if test="workCost != null">work_cost = #{workCost},</if>
<if test="workStatus != null">work_status = #{workStatus},</if>
<if test="outWorkId != null">out_work_id = #{outWorkId},</if>
<if test="outWorkCode != null">out_work_code = #{outWorkCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
@ -238,4 +276,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where del_flag = '0'
</select>
<select id="getMaintenancePersonList" parameterType="EquPerson" resultType="com.op.device.domain.EquPerson">
select
su.user_id AS userId,
su.user_name AS userName,
su.nick_name AS nickName,
CONCAT(su.nick_name,su.user_name) AS teamUserName,
sp.post_code AS postCode,
sp.post_name AS postName
from sys_user su
left join sys_user_post sup on su.user_id = sup.user_id
left join sys_post sp on sup.post_id = sp.post_id
where su.del_flag = '0'
and sp.post_id = '12'
</select>
</mapper>

@ -0,0 +1,101 @@
<?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.op.device.mapper.EquTeamMapper">
<resultMap type="EquTeam" id="EquTeamResult">
<result property="id" column="id" />
<result property="teamCode" column="team_code" />
<result property="teamName" column="team_name" />
<result property="teamType" column="team_type" />
<result property="teamPerson" column="team_person" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="factoryCode" column="factory_code" />
</resultMap>
<sql id="selectEquTeamVo">
select id, team_code, team_name, team_type, team_person, create_by, create_time, update_by, update_time, del_flag, factory_code from equ_team
</sql>
<select id="selectEquTeamList" parameterType="EquTeam" resultMap="EquTeamResult">
<include refid="selectEquTeamVo"/>
<where>
<if test="teamCode != null and teamCode != ''"> and team_code like concat('%', #{teamCode}, '%')</if>
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
<if test="teamType != null and teamType != ''"> and team_type = #{teamType}</if>
<if test="teamPerson != null and teamPerson != ''"> and team_person = #{teamPerson}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
and del_flag = '0'
</where>
</select>
<select id="selectEquTeamById" parameterType="String" resultMap="EquTeamResult">
<include refid="selectEquTeamVo"/>
where id = #{id}
where del_flag = '0'
</select>
<insert id="insertEquTeam" parameterType="EquTeam">
insert into equ_team
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="teamCode != null">team_code,</if>
<if test="teamName != null">team_name,</if>
<if test="teamType != null">team_type,</if>
<if test="teamPerson != null">team_person,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="factoryCode != null">factory_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="teamCode != null">#{teamCode},</if>
<if test="teamName != null">#{teamName},</if>
<if test="teamType != null">#{teamType},</if>
<if test="teamPerson != null">#{teamPerson},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="factoryCode != null">#{factoryCode},</if>
</trim>
</insert>
<update id="updateEquTeam" parameterType="EquTeam">
update equ_team
<trim prefix="SET" suffixOverrides=",">
<if test="teamCode != null">team_code = #{teamCode},</if>
<if test="teamName != null">team_name = #{teamName},</if>
<if test="teamType != null">team_type = #{teamType},</if>
<if test="teamPerson != null">team_person = #{teamPerson},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim>
where id = #{id}
and del_flag = '0'
</update>
<delete id="deleteEquTeamById" parameterType="String">
delete from equ_team where id = #{id}
</delete>
<delete id="deleteEquTeamByIds" parameterType="String">
delete from equ_team where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save