Merge remote-tracking branch 'origin/master'

highway
Yangwl 2 years ago
commit fdf2c8ce69

@ -35,6 +35,26 @@ public class EquCheckItemController extends BaseController {
@Autowired
private IEquCheckItemService equCheckItemService;
/**
* codecode
* @return
*/
@RequiresPermissions("device:item:list")
@GetMapping(value = "/getEquipmentCodeList/{itemCode}")
public AjaxResult getEquipmentCodeListByItemCode(@PathVariable("itemCode") String itemCode) {
return equCheckItemService.getEquipmentCodeListByItemCode(itemCode);
}
/**
* list
* @return
*/
@RequiresPermissions("device:item:list")
@GetMapping("/getEquipmentList")
public AjaxResult getEquipmentList() {
return equCheckItemService.getEquipmentList();
}
/**
*
*/

@ -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.EquFaultType;
import com.op.device.service.IEquFaultTypeService;
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 wws
* @date 2023-10-12
*/
@RestController
@RequestMapping("/faultType")
public class EquFaultTypeController extends BaseController {
@Autowired
private IEquFaultTypeService equFaultTypeService;
/**
*
*/
@RequiresPermissions("device:faultType:list")
@GetMapping("/list")
public TableDataInfo list(EquFaultType equFaultType) {
startPage();
List<EquFaultType> list = equFaultTypeService.selectEquFaultTypeList(equFaultType);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:faultType:export")
@Log(title = "故障类型维护", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquFaultType equFaultType) {
List<EquFaultType> list = equFaultTypeService.selectEquFaultTypeList(equFaultType);
ExcelUtil<EquFaultType> util = new ExcelUtil<EquFaultType>(EquFaultType.class);
util.exportExcel(response, list, "故障类型维护数据");
}
/**
*
*/
@RequiresPermissions("device:faultType:query")
@GetMapping(value = "/{faultId}")
public AjaxResult getInfo(@PathVariable("faultId") String faultId) {
return success(equFaultTypeService.selectEquFaultTypeByFaultId(faultId));
}
/**
*
*/
@RequiresPermissions("device:faultType:add")
@Log(title = "故障类型维护", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquFaultType equFaultType) {
return toAjax(equFaultTypeService.insertEquFaultType(equFaultType));
}
/**
*
*/
@RequiresPermissions("device:faultType:edit")
@Log(title = "故障类型维护", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquFaultType equFaultType) {
return toAjax(equFaultTypeService.updateEquFaultType(equFaultType));
}
/**
*
*/
@RequiresPermissions("device:faultType:remove")
@Log(title = "故障类型维护", businessType = BusinessType.DELETE)
@DeleteMapping("/{faultIds}")
public AjaxResult remove(@PathVariable String[] faultIds) {
return toAjax(equFaultTypeService.deleteEquFaultTypeByFaultIds(faultIds));
}
}

@ -0,0 +1,146 @@
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_fault_type
*
* @author wws
* @date 2023-10-12
*/
public class EquFaultType extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String faultId;
/** 故障类型编码 */
@Excel(name = "故障类型编码")
private String faultCode;
/** 故障类型 */
@Excel(name = "故障类型")
private String faultType;
/** 故障子类 */
@Excel(name = "故障子类")
private String faultSubclass;
/** 备注 */
@Excel(name = "备注")
private String faultRemark;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标志 */
@Excel(name = "删除标志")
private String delFlag;
public void setFaultId(String faultId) {
this.faultId = faultId;
}
public String getFaultId() {
return faultId;
}
public void setFaultCode(String faultCode) {
this.faultCode = faultCode;
}
public String getFaultCode() {
return faultCode;
}
public void setFaultType(String faultType) {
this.faultType = faultType;
}
public String getFaultType() {
return faultType;
}
public void setFaultSubclass(String faultSubclass) {
this.faultSubclass = faultSubclass;
}
public String getFaultSubclass() {
return faultSubclass;
}
public void setFaultRemark(String faultRemark) {
this.faultRemark = faultRemark;
}
public String getFaultRemark() {
return faultRemark;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("faultId", getFaultId())
.append("faultCode", getFaultCode())
.append("faultType", getFaultType())
.append("faultSubclass", getFaultSubclass())
.append("faultRemark", getFaultRemark())
.append("factoryCode", getFactoryCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,181 @@
package com.op.device.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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_item_equipment
*
* @author wws
* @date 2023-10-12
*/
public class EquItemEquipment extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 关联code */
@Excel(name = "关联code")
private String connCode;
/** 检查项code */
@Excel(name = "检查项code")
private String itemCode;
/** 设备code */
@Excel(name = "设备code")
private String equipmentCode;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标识 */
private String delFlag;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
/** 更新人 */
@Excel(name = "更新人")
private String updatedBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedTime;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setConnCode(String connCode) {
this.connCode = connCode;
}
public String getConnCode() {
return connCode;
}
public void setItemCode(String itemCode) {
this.itemCode = itemCode;
}
public String getItemCode() {
return itemCode;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getCreatedTime() {
return createdTime;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUpdatedTime() {
return updatedTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("connCode", getConnCode())
.append("itemCode", getItemCode())
.append("equipmentCode", getEquipmentCode())
.append("factoryCode", getFactoryCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.toString();
}
}

@ -59,6 +59,17 @@ public class EquCheckItemDTO {
// 创建日期结束
private String createTimeEnd;
// 设备编码list
private List<String> equipmentCodeList;
public List<String> getEquipmentCodeList() {
return equipmentCodeList;
}
public void setEquipmentCodeList(List<String> equipmentCodeList) {
this.equipmentCodeList = equipmentCodeList;
}
public List<Date> getCreatedTimeArray() {
return createdTimeArray;
}

@ -41,6 +41,26 @@ public class EquCheckItemVO {
private String updatedBy ;
// 标准列表
private List<EquCheckItemDetail> formStandard;
// 设备名称
private String equipmentName;
// 设备编码
private String equipmentCode;
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getItemId() {
return itemId;

@ -78,4 +78,10 @@ public interface EquCheckItemDetailMapper {
* @param itemId
*/
void deleteEquCheckItemDetailByItemId(String itemId);
/**
* -id
* @param itemId
*/
void delEquCheckItemDetailByItemId(String itemId);
}

@ -3,6 +3,7 @@ package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquCheckItem;
import com.op.device.domain.vo.EquCheckItemVO;
/**
* Mapper
@ -71,4 +72,10 @@ public interface EquCheckItemMapper {
* @return
*/
int selectSerialNumber();
/**
* namecode
* @return
*/
List<EquCheckItemVO> selectAllEquipmentList();
}

@ -0,0 +1,61 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquFaultType;
/**
* Mapper
*
* @author wws
* @date 2023-10-12
*/
public interface EquFaultTypeMapper {
/**
*
*
* @param faultId
* @return
*/
public EquFaultType selectEquFaultTypeByFaultId(String faultId);
/**
*
*
* @param equFaultType
* @return
*/
public List<EquFaultType> selectEquFaultTypeList(EquFaultType equFaultType);
/**
*
*
* @param equFaultType
* @return
*/
public int insertEquFaultType(EquFaultType equFaultType);
/**
*
*
* @param equFaultType
* @return
*/
public int updateEquFaultType(EquFaultType equFaultType);
/**
*
*
* @param faultId
* @return
*/
public int deleteEquFaultTypeByFaultId(String faultId);
/**
*
*
* @param faultIds
* @return
*/
public int deleteEquFaultTypeByFaultIds(String[] faultIds);
}

@ -0,0 +1,86 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquItemEquipment;
/**
* /Mapper
*
* @author wws
* @date 2023-10-12
*/
public interface EquItemEquipmentMapper {
/**
* /
*
* @param id /
* @return /
*/
public EquItemEquipment selectEquItemEquipmentById(String id);
/**
* /
*
* @param equItemEquipment /
* @return /
*/
public List<EquItemEquipment> selectEquItemEquipmentList(EquItemEquipment equItemEquipment);
/**
* /
*
* @param equItemEquipment /
* @return
*/
public int insertEquItemEquipment(EquItemEquipment equItemEquipment);
/**
* /
*
* @param equItemEquipment /
* @return
*/
public int updateEquItemEquipment(EquItemEquipment equItemEquipment);
/**
* /
*
* @param id /
* @return
*/
public int deleteEquItemEquipmentById(String id);
/**
* /
*
* @param ids
* @return
*/
public int deleteEquItemEquipmentByIds(String[] ids);
/**
*
* @return
*/
int selectSerialNumber();
/**
* codecode
* @param itemCode
* @return
*/
List<String> selectEquipmentCodeList(String itemCode);
/**
* code
* @param itemCode
*/
void deleteEquItemEquipmentByItemCode(String itemCode);
/**
* -itemId
* @param itemId
*/
void delEquItemEquipmentByItemId(String itemId);
}

@ -41,7 +41,7 @@ public interface IEquCheckItemService {
/**
*
*
* @param equCheckItem
* @param equCheckItemDTO
* @return
*/
public AjaxResult updateEquCheckItem(EquCheckItemDTO equCheckItemDTO);
@ -61,4 +61,16 @@ public interface IEquCheckItemService {
* @return
*/
public int deleteEquCheckItemByItemId(String itemId);
/**
* list
* @return
*/
AjaxResult getEquipmentList();
/**
* codecode
* @return
*/
AjaxResult getEquipmentCodeListByItemCode(String itemCode);
}

@ -0,0 +1,60 @@
package com.op.device.service;
import java.util.List;
import com.op.device.domain.EquFaultType;
/**
* Service
*
* @author wws
* @date 2023-10-12
*/
public interface IEquFaultTypeService {
/**
*
*
* @param faultId
* @return
*/
public EquFaultType selectEquFaultTypeByFaultId(String faultId);
/**
*
*
* @param equFaultType
* @return
*/
public List<EquFaultType> selectEquFaultTypeList(EquFaultType equFaultType);
/**
*
*
* @param equFaultType
* @return
*/
public int insertEquFaultType(EquFaultType equFaultType);
/**
*
*
* @param equFaultType
* @return
*/
public int updateEquFaultType(EquFaultType equFaultType);
/**
*
*
* @param faultIds
* @return
*/
public int deleteEquFaultTypeByFaultIds(String[] faultIds);
/**
*
*
* @param faultId
* @return
*/
public int deleteEquFaultTypeByFaultId(String faultId);
}

@ -12,9 +12,11 @@ import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.log.annotation.Log;
import com.op.device.domain.EquCheckItemDetail;
import com.op.device.domain.EquItemEquipment;
import com.op.device.domain.dto.EquCheckItemDTO;
import com.op.device.domain.vo.EquCheckItemVO;
import com.op.device.mapper.EquCheckItemDetailMapper;
import com.op.device.mapper.EquItemEquipmentMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -42,6 +44,8 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
private EquCheckItemMapper equCheckItemMapper;
@Autowired
private EquCheckItemDetailMapper equCheckItemDetailMapper;
@Autowired
private EquItemEquipmentMapper equItemEquipmentMapper;
/**
*
@ -96,7 +100,6 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
*
* @param equCheckItemDTO
* @return
* TODO
*/
@Override
@DS("#header.poolName")
@ -160,6 +163,27 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
equCheckItemDetailMapper.insertEquCheckItemDetail(detail);
}
// 处理关联设备信息
for (String code : equCheckItemDTO.getEquipmentCodeList()) {
EquItemEquipment equItemEquipment = new EquItemEquipment();
// 获取流水号
String cnnSerialNum = String.format("%03d", equItemEquipmentMapper.selectSerialNumber());
equItemEquipment.setId(IdUtils.fastSimpleUUID());
equItemEquipment.setConnCode(DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+cnnSerialNum);
equItemEquipment.setItemCode(equCheckItem.getItemCode());
equItemEquipment.setEquipmentCode(code);
equItemEquipment.setFactoryCode(factory);
equItemEquipment.setCreatedBy(SecurityContextHolder.getUserName());
equItemEquipment.setCreatedTime(DateUtils.getNowDate());
equItemEquipment.setUpdatedBy(SecurityContextHolder.getUserName());
equItemEquipment.setUpdatedTime(DateUtils.getNowDate());
// 插入数据库
equItemEquipmentMapper.insertEquItemEquipment(equItemEquipment);
}
return success("新增成功");
}
@ -191,9 +215,10 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
equCheckItemMapper.updateEquCheckItem(equCheckItem);
// 删除所有标准
// 删除所有该检查项标准
equCheckItemDetailMapper.deleteEquCheckItemDetailByItemId(equCheckItem.getItemId());
// 处理检查项详情信息
for (EquCheckItemDetail detail : equCheckItemDTO.getFormStandard()) {
// 获取标准流水号
String detailSerialNum = String.format("%03d", equCheckItemDetailMapper.selectSerialNumber(equCheckItem.getItemCode()));
@ -210,6 +235,30 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
// 插入到数据库
equCheckItemDetailMapper.insertEquCheckItemDetail(detail);
}
// 删除所有该检查项关联设备
equItemEquipmentMapper.deleteEquItemEquipmentByItemCode(equCheckItemDTO.getItemCode());
// 处理关联设备信息
for (String code : equCheckItemDTO.getEquipmentCodeList()) {
EquItemEquipment equItemEquipment = new EquItemEquipment();
// 获取流水号
String cnnSerialNum = String.format("%03d", equItemEquipmentMapper.selectSerialNumber());
equItemEquipment.setId(IdUtils.fastSimpleUUID());
equItemEquipment.setConnCode(DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+cnnSerialNum);
equItemEquipment.setItemCode(equCheckItem.getItemCode());
equItemEquipment.setEquipmentCode(code);
equItemEquipment.setFactoryCode(equCheckItemDTO.getFactoryCode());
equItemEquipment.setCreatedBy(SecurityContextHolder.getUserName());
equItemEquipment.setCreatedTime(DateUtils.getNowDate());
equItemEquipment.setUpdatedBy(SecurityContextHolder.getUserName());
equItemEquipment.setUpdatedTime(DateUtils.getNowDate());
// 插入数据库
equItemEquipmentMapper.insertEquItemEquipment(equItemEquipment);
}
return success("修改成功");
}
@ -223,7 +272,10 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
@DS("#header.poolName")
public int deleteEquCheckItemByItemIds(String[] itemIds) {
for (String data : itemIds) {
equCheckItemDetailMapper.deleteEquCheckItemDetailByItemId(data);
// 逻辑删除检查项详情信息
equCheckItemDetailMapper.delEquCheckItemDetailByItemId(data);
// 逻辑删除设备关联
equItemEquipmentMapper.delEquItemEquipmentByItemId(data);
}
return equCheckItemMapper.deleteEquCheckItemByItemIds(itemIds);
}
@ -237,8 +289,32 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
@Override
@DS("#header.poolName")
public int deleteEquCheckItemByItemId(String itemId) {
// 通过id删除标准信息
equCheckItemDetailMapper.deleteEquCheckItemDetailByItemId(itemId);
// 逻辑删除标准
equCheckItemDetailMapper.delEquCheckItemDetailByItemId(itemId);
// 逻辑删除设备关联
equItemEquipmentMapper.delEquItemEquipmentByItemId(itemId);
return equCheckItemMapper.deleteEquCheckItemByItemId(itemId);
}
/**
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getEquipmentList() {
List<EquCheckItemVO> equipmentList = equCheckItemMapper.selectAllEquipmentList();
return success(equipmentList);
}
/**
* codecode
* @return
*/
@Override
public AjaxResult getEquipmentCodeListByItemCode(String itemCode) {
List<String> equipmentCodeList = equItemEquipmentMapper.selectEquipmentCodeList(itemCode);
return success(equipmentCodeList);
}
}

@ -0,0 +1,89 @@
package com.op.device.service.impl;
import java.util.List;
import com.op.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquFaultTypeMapper;
import com.op.device.domain.EquFaultType;
import com.op.device.service.IEquFaultTypeService;
/**
* Service
*
* @author wws
* @date 2023-10-12
*/
@Service
public class EquFaultTypeServiceImpl implements IEquFaultTypeService {
@Autowired
private EquFaultTypeMapper equFaultTypeMapper;
/**
*
*
* @param faultId
* @return
*/
@Override
public EquFaultType selectEquFaultTypeByFaultId(String faultId) {
return equFaultTypeMapper.selectEquFaultTypeByFaultId(faultId);
}
/**
*
*
* @param equFaultType
* @return
*/
@Override
public List<EquFaultType> selectEquFaultTypeList(EquFaultType equFaultType) {
return equFaultTypeMapper.selectEquFaultTypeList(equFaultType);
}
/**
*
*
* @param equFaultType
* @return
*/
@Override
public int insertEquFaultType(EquFaultType equFaultType) {
equFaultType.setCreateTime(DateUtils.getNowDate());
return equFaultTypeMapper.insertEquFaultType(equFaultType);
}
/**
*
*
* @param equFaultType
* @return
*/
@Override
public int updateEquFaultType(EquFaultType equFaultType) {
equFaultType.setUpdateTime(DateUtils.getNowDate());
return equFaultTypeMapper.updateEquFaultType(equFaultType);
}
/**
*
*
* @param faultIds
* @return
*/
@Override
public int deleteEquFaultTypeByFaultIds(String[] faultIds) {
return equFaultTypeMapper.deleteEquFaultTypeByFaultIds(faultIds);
}
/**
*
*
* @param faultId
* @return
*/
@Override
public int deleteEquFaultTypeByFaultId(String faultId) {
return equFaultTypeMapper.deleteEquFaultTypeByFaultId(faultId);
}
}

@ -132,18 +132,24 @@
where detail_id = #{detailId} and del_flag = '0'
</update>
<delete id="deleteEquCheckItemDetailByItemId" parameterType="String">
delete from equ_check_item_detail
where parent_code = (
select item_code from equ_check_item where item_id = #{itemId} )
</delete>
<delete id="deleteEquCheckItemDetailByDetailId" parameterType="String">
update equ_check_item_detail set del_flag = '1' where detail_id = #{detailId}
delete from equ_check_item_detail where detail_id = #{detailId}
</delete>
<delete id="deleteEquCheckItemDetailByDetailIds" parameterType="String">
update equ_check_item_detail set del_flag = '1' where detail_id in
delete from equ_check_item_detail where detail_id in
<foreach item="detailId" collection="array" open="(" separator="," close=")">
#{detailId}
</foreach>
</delete>
<delete id="deleteEquCheckItemDetailByItemId" parameterType="String">
<delete id="delEquCheckItemDetailByItemId">
update equ_check_item_detail
set del_flag = '1'
where parent_code = (

@ -12,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="itemType" column="item_type" />
<result property="itemTypeName" column="item_type_name" />
<result property="itemRemark" column="item_remark" />
<result property="factoryCode" column="factoryCode" />
<result property="factoryCode" column="factory_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
@ -68,7 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE CONVERT(date, GETDATE()) = CONVERT(date,created_time) and del_flag = '0'
</select>
<insert id="insertEquCheckItem" parameterType="EquCheckItem">
<select id="selectAllEquipmentList" resultType="com.op.device.domain.vo.EquCheckItemVO">
select equipment_name AS 'equipmentName',equipment_code AS 'equipmentCode' from base_equipment where del_flag = '0'
</select>
<insert id="insertEquCheckItem" parameterType="EquCheckItem">
insert into equ_check_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="itemId != null">item_id,</if>

@ -0,0 +1,118 @@
<?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.EquFaultTypeMapper">
<resultMap type="EquFaultType" id="EquFaultTypeResult">
<result property="faultId" column="fault_id" />
<result property="faultCode" column="fault_code" />
<result property="faultType" column="fault_type" />
<result property="faultSubclass" column="fault_subclass" />
<result property="faultRemark" column="fault_remark" />
<result property="factoryCode" column="factory_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectEquFaultTypeVo">
select fault_id, fault_code, fault_type, fault_subclass, fault_remark, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_fault_type
</sql>
<select id="selectEquFaultTypeList" parameterType="EquFaultType" resultMap="EquFaultTypeResult">
<include refid="selectEquFaultTypeVo"/>
<where>
<if test="faultCode != null and faultCode != ''"> and fault_code like concat('%', #{faultCode}, '%')</if>
<if test="faultType != null and faultType != ''"> and fault_type like concat('%', #{faultType}, '%')</if>
<if test="faultSubclass != null and faultSubclass != ''"> and fault_subclass like concat('%', #{faultSubclass}, '%')</if>
<if test="faultRemark != null and faultRemark != ''"> and fault_remark = #{faultRemark}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
</select>
<select id="selectEquFaultTypeByFaultId" parameterType="String" resultMap="EquFaultTypeResult">
<include refid="selectEquFaultTypeVo"/>
where fault_id = #{faultId}
</select>
<insert id="insertEquFaultType" parameterType="EquFaultType">
insert into equ_fault_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="faultId != null">fault_id,</if>
<if test="faultCode != null and faultCode != ''">fault_code,</if>
<if test="faultType != null and faultType != ''">fault_type,</if>
<if test="faultSubclass != null and faultSubclass != ''">fault_subclass,</if>
<if test="faultRemark != null">fault_remark,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="faultId != null">#{faultId},</if>
<if test="faultCode != null and faultCode != ''">#{faultCode},</if>
<if test="faultType != null and faultType != ''">#{faultType},</if>
<if test="faultSubclass != null and faultSubclass != ''">#{faultSubclass},</if>
<if test="faultRemark != null">#{faultRemark},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEquFaultType" parameterType="EquFaultType">
update equ_fault_type
<trim prefix="SET" suffixOverrides=",">
<if test="faultCode != null and faultCode != ''">fault_code = #{faultCode},</if>
<if test="faultType != null and faultType != ''">fault_type = #{faultType},</if>
<if test="faultSubclass != null and faultSubclass != ''">fault_subclass = #{faultSubclass},</if>
<if test="faultRemark != null">fault_remark = #{faultRemark},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where fault_id = #{faultId}
</update>
<delete id="deleteEquFaultTypeByFaultId" parameterType="String">
delete from equ_fault_type where fault_id = #{faultId}
</delete>
<delete id="deleteEquFaultTypeByFaultIds" parameterType="String">
delete from equ_fault_type where fault_id in
<foreach item="faultId" collection="array" open="(" separator="," close=")">
#{faultId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,134 @@
<?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.EquItemEquipmentMapper">
<resultMap type="EquItemEquipment" id="EquItemEquipmentResult">
<result property="id" column="id" />
<result property="connCode" column="conn_code" />
<result property="itemCode" column="item_code" />
<result property="equipmentCode" column="equipment_code" />
<result property="factoryCode" column="factory_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="delFlag" column="del_flag" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
</resultMap>
<sql id="selectEquItemEquipmentVo">
select id, conn_code, item_code, equipment_code, factory_code, attr1, attr2, attr3, del_flag, created_by, created_time, updated_by, updated_time from equ_item_equipment
</sql>
<select id="selectEquItemEquipmentList" parameterType="EquItemEquipment" resultMap="EquItemEquipmentResult">
<include refid="selectEquItemEquipmentVo"/>
<where>
<if test="connCode != null and connCode != ''"> and conn_code = #{connCode}</if>
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
</where>
and del_flag = '0'
</select>
<select id="selectEquItemEquipmentById" parameterType="String" resultMap="EquItemEquipmentResult">
<include refid="selectEquItemEquipmentVo"/>
where id = #{id} and del_flag = '0'
</select>
<select id="selectSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(id)+1 AS serialNum
FROM equ_item_equipment
WHERE CONVERT(date, GETDATE()) = CONVERT(date,created_time) and del_flag = '0'
</select>
<select id="selectEquipmentCodeList" resultType="java.lang.String">
select equipment_code AS 'equipmentCode' from equ_item_equipment where item_code = #{itemCode} and del_flag = '0'
</select>
<insert id="insertEquItemEquipment" parameterType="EquItemEquipment">
insert into equ_item_equipment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="connCode != null and connCode != ''">conn_code,</if>
<if test="itemCode != null and itemCode != ''">item_code,</if>
<if test="equipmentCode != null and equipmentCode != ''">equipment_code,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createdBy != null and createdBy != ''">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null and updatedBy != ''">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="connCode != null and connCode != ''">#{connCode},</if>
<if test="itemCode != null and itemCode != ''">#{itemCode},</if>
<if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createdBy != null and createdBy != ''">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null and updatedBy != ''">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
</trim>
</insert>
<update id="updateEquItemEquipment" parameterType="EquItemEquipment">
update equ_item_equipment
<trim prefix="SET" suffixOverrides=",">
<if test="connCode != null and connCode != ''">conn_code = #{connCode},</if>
<if test="itemCode != null and itemCode != ''">item_code = #{itemCode},</if>
<if test="equipmentCode != null and equipmentCode != ''">equipment_code = #{equipmentCode},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createdBy != null and createdBy != ''">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null and updatedBy != ''">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
</trim>
where id = #{id} and del_flag = '0'
</update>
<delete id="deleteEquItemEquipmentById" parameterType="String">
delete from equ_item_equipment where id = #{id}
</delete>
<delete id="deleteEquItemEquipmentByIds" parameterType="String">
delete from equ_item_equipment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteEquItemEquipmentByItemCode">
delete from equ_item_equipment where item_code = #{itemCode}
</delete>
<delete id="delEquItemEquipmentByItemId">
update equ_item_equipment
set del_flag = '1'
where item_code =
(select item_code from equ_check_item where item_id = #{itemId})
</delete>
</mapper>

@ -7,11 +7,13 @@ import com.op.common.core.web.domain.AjaxResult;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.mes.service.IWCSInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -55,6 +57,18 @@ public class WCSInterfaceController extends BaseController {
return success(WCInterfaceService.requestDestinationStations(wcsdto));
}
@Log(title = "获取料罐用量", businessType = BusinessType.GRANT)
@PostMapping("/saveLGusedLog")
public AjaxResult saveLGusedLog(@RequestBody List<LGInfoDto> lgdtos) {
if(CollectionUtils.isEmpty(lgdtos)){
return error("参数信息为空");
}
if(StringUtils.isBlank(lgdtos.get(0).getFactoryCode())){
return error("工厂信息为空");
}
return success(WCInterfaceService.saveLGusedLog(lgdtos));
}
/**
* MES
*/
@ -72,6 +86,14 @@ public class WCSInterfaceController extends BaseController {
if(StringUtils.isEmpty(boardDTO.getYmd())){
boardDTO.setYmd(DateUtils.getDate());
}
if(StringUtils.isEmpty(boardDTO.getEquTypeCode())){//设备类型
return error("[equTypeCode] is not null");
}
return success(WCInterfaceService.getMesBoardEquProductionToday(boardDTO));
}
public static void main(String args[]){
System.out.println(DateUtils.getDate());
}
}

@ -0,0 +1,104 @@
package com.op.mes.domain.dto;
import java.util.Date;
import java.util.List;
/**
*
*
* @author Open Platform
* @date 2023-07-03
*/
public class LGInfoDto {
private String deviceCode;
private String deviceName;
private String id;
private String used;
private String usedUnit;
private String createDate;
private Date lgCreateTime;
private Date createTime;
private String factoryCode;
private String delFlag;
public Date getLgCreateTime() {
return lgCreateTime;
}
public void setLgCreateTime(Date lgCreateTime) {
this.lgCreateTime = lgCreateTime;
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getUsed() {
return used;
}
public void setUsed(String used) {
this.used = used;
}
public String getUsedUnit() {
return usedUnit;
}
public void setUsedUnit(String usedUnit) {
this.usedUnit = usedUnit;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}

@ -1,11 +1,13 @@
package com.op.mes.mapper;
import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.SysDept;
import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataItemsDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -30,4 +32,10 @@ public interface MesMapper {
List<BoardDTO> getEveryNum(BoardDTO boardDTO);
List<SysDept> getBoardFactory(BoardDTO boardDTO);
int addBatchLGInfo(@Param("list") List<LGInfoDto> lgdtos);
List<BoardDTO> getTotalNumL(BoardDTO boardDTO);
List<BoardDTO> getEveryNumL(BoardDTO boardDTO);
}

@ -2,6 +2,7 @@ package com.op.mes.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.SysDept;
import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO;
@ -22,4 +23,6 @@ public interface IWCSInterfaceService {
Map getMesBoardEquProductionToday(BoardDTO boardDTO);
List<SysDept> getBoardFactory(BoardDTO boardDTO);
String saveLGusedLog(List<LGInfoDto> lgdtos);
}

@ -8,6 +8,7 @@ import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.mes.domain.MesStationArrive;
import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.mes.mapper.MesMapper;
import com.op.mes.mapper.MesStationArriveMapper;
import com.op.mes.mapper.ProRfidProcessDetailMapper;
@ -146,10 +147,17 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
public Map getMesBoardEquProductionToday(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push("ds_"+boardDTO.getFactory());// 这是数据源的key
Map boardMap = new HashMap();
List<BoardDTO> totals = null;
List<BoardDTO> everys = null;
if("equ_type_lg".equals(boardDTO.getEquTypeCode())){//equ_type_lg 湿料罐
boardDTO.setYmd(boardDTO.getYmd().replace("-",""));
totals = mesMapper.getTotalNumL(boardDTO);
everys = mesMapper.getEveryNumL(boardDTO);
}else{//成型机、烘房、收坯机
totals = mesMapper.getTotalNum(boardDTO);
everys = mesMapper.getEveryNum(boardDTO);
}
List<BoardDTO> totals = mesMapper.getTotalNum(boardDTO);//
List<BoardDTO> everys = mesMapper.getEveryNum(boardDTO);//
boardMap.put("totalNum", totals);
boardMap.put("everyNum", everys);
@ -158,10 +166,24 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
@Override
public List<SysDept> getBoardFactory(BoardDTO boardDTO) {
//DynamicDataSourceContextHolder.push("master");// 这是数据源的key
DynamicDataSourceContextHolder.push("master");// 这是数据源的key
return mesMapper.getBoardFactory(boardDTO);
}
@Override
public String saveLGusedLog(List<LGInfoDto> lgdtos) {
DynamicDataSourceContextHolder.push("ds_"+lgdtos.get(0).getFactoryCode());// 这是数据源的key
Date nowTime = DateUtils.getNowDate();
for(LGInfoDto lgdto:lgdtos){
lgdto.setId(IdUtils.simpleUUID());
lgdto.setCreateTime(nowTime);
lgdto.setDeviceCode("L"+lgdto.getDeviceCode());
}
int saveNum = mesMapper.addBatchLGInfo(lgdtos);
return "保存成功条数:"+saveNum;
}
public static void main(String args[]){
System.out.println(DateUtils.getDate());

@ -39,6 +39,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null">#{factoryCode},</if>
</trim>
</insert>
<insert id="addBatchLGInfo">
insert into pro_lg_used_log(
id,device_code,
used,used_unit,
createDate,lg_create_time,
factory_code,create_time
) values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.id},#{item.deviceCode},
#{item.used},#{item.usedUnit},
#{item.createDate},#{item.lgCreateTime},
#{item.factoryCode},#{item.createTime}
)
</foreach>
</insert>
<select id="getWetPlanDetail" resultType="com.op.system.api.domain.dto.WCSDataItemsDTO">
select
@ -73,7 +89,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
equ.equipment_type_name equTypeName
from mes_material_transfer_result mt
left join base_equipment equ on mt.equipmentCode = equ.equipment_code
where CONVERT(varchar(10),mt.create_time, 120) = #{ymd} and equ.equipment_name is not null
where CONVERT(varchar(10),mt.update_time, 120) = #{ymd} and equ.equipment_name is not null
and equ.equipment_type_code = #{equTypeCode}
group by equ.equipment_type_code,
equ.equipment_type_name
</select>
@ -84,7 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
equ.equipment_type_code equTypeCode
from mes_material_transfer_result mt
left join base_equipment equ on mt.equipmentCode = equ.equipment_code
where CONVERT(varchar(10),mt.create_time, 120) = #{ymd} and equ.equipment_name is not null
where CONVERT(varchar(10),mt.update_time, 120) = #{ymd} and equ.equipment_name is not null
and equ.equipment_type_code = #{equTypeCode}
group by mt.equipmentCode,
equ.equipment_name,
equ.equipment_type_code
@ -94,6 +112,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dept_name deptName
from sys_dept where parent_id = '1' and del_flag = '0'
</select>
<select id="getTotalNumL" resultType="com.op.system.api.domain.dto.BoardDTO">
select count(0) totalNum,
equ.equipment_type_code equTypeCode,
equ.equipment_type_name equTypeName
from pro_lg_used_log mt
left join base_equipment equ on mt.device_code = equ.equipment_code
where mt.createDate = #{ymd} and equ.equipment_name is not null
and equ.equipment_type_code = #{equTypeCode}
group by equ.equipment_type_code,
equ.equipment_type_name
</select>
<select id="getEveryNumL" resultType="com.op.system.api.domain.dto.BoardDTO">
select count(0) totalNum,
mt.device_code equCode,
equ.equipment_name equName,
equ.equipment_type_code equTypeCode
from pro_lg_used_log mt
left join base_equipment equ on mt.device_code = equ.equipment_code
where mt.createDate = #{ymd} and equ.equipment_name is not null
and equ.equipment_type_code = #{equTypeCode}
group by mt.device_code,
equ.equipment_name,
equ.equipment_type_code
</select>
</mapper>

Loading…
Cancel
Save