feat(停工停产): 新增检查记录
parent
7695debf57
commit
8868651d0c
@ -0,0 +1,47 @@
|
|||||||
|
package com.op.technology.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.op.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 数据库表:pro_check_record
|
||||||
|
*
|
||||||
|
* @author : huangjinxian
|
||||||
|
* @version : 1.0
|
||||||
|
* @since : 2026/5/27
|
||||||
|
*/
|
||||||
|
@SuppressWarnings({"unused", "SpellCheckingInspection"})
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class ProCheckRecord extends BaseEntity {
|
||||||
|
//主键
|
||||||
|
Integer recordId;
|
||||||
|
|
||||||
|
//记录日期
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
Date recordTime;
|
||||||
|
|
||||||
|
//记录人id
|
||||||
|
String recordPerson;
|
||||||
|
|
||||||
|
//异常状态,0-异常,1-正常
|
||||||
|
Boolean abnoStatus;
|
||||||
|
|
||||||
|
//是否删除
|
||||||
|
Boolean isDel;
|
||||||
|
|
||||||
|
|
||||||
|
//记录人名称关联出来(数据库SQLserver,跨库lanju_op_cloud,表sys_user,关联字段user_id)
|
||||||
|
String recordPersonName;
|
||||||
|
|
||||||
|
//查询从从表关联出来的记录(表pro_check_record_detail,关联字段recordId)
|
||||||
|
private List<ProCheckRecordDetail> details = new ArrayList<>();
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package com.op.technology.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.op.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 数据库表:pro_check_record_detail
|
||||||
|
*
|
||||||
|
* @author : huangjinxian
|
||||||
|
* @version : 1.0
|
||||||
|
* @since : 2026/5/27
|
||||||
|
*/
|
||||||
|
@SuppressWarnings({"unused", "SpellCheckingInspection"})
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class ProCheckRecordDetail extends BaseEntity {
|
||||||
|
//主键
|
||||||
|
Integer detailId;
|
||||||
|
|
||||||
|
//记录id(关联主表id)
|
||||||
|
Integer recordId;
|
||||||
|
|
||||||
|
//项目名称
|
||||||
|
String itemName;
|
||||||
|
|
||||||
|
//排序号
|
||||||
|
List<String> checkObject;
|
||||||
|
|
||||||
|
//排序号
|
||||||
|
Integer sortOrder;
|
||||||
|
|
||||||
|
//检查值
|
||||||
|
String checkValue;
|
||||||
|
|
||||||
|
//异常信息
|
||||||
|
String abnoRemark;
|
||||||
|
//是否删除
|
||||||
|
Boolean isDel;
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package com.op.technology.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.op.technology.domain.ProCheckRecord;
|
||||||
|
import com.op.technology.mapper.ProCheckRecordMapper;
|
||||||
|
import com.op.technology.service.IProCheckRecordService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查记录 Service 业务层处理
|
||||||
|
*
|
||||||
|
* @author huangjinxian
|
||||||
|
* @date 2026-06-25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ProCheckRecordServiceImpl implements IProCheckRecordService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProCheckRecordMapper proCheckRecordMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public ProCheckRecord selectProCheckRecordById(Integer recordId) {
|
||||||
|
return proCheckRecordMapper.selectById(recordId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public List<ProCheckRecord> selectProCheckRecordList(ProCheckRecord proCheckRecord) {
|
||||||
|
return proCheckRecordMapper.selectList(proCheckRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public int insertProCheckRecord(ProCheckRecord proCheckRecord) {
|
||||||
|
return proCheckRecordMapper.insert(proCheckRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public int updateProCheckRecord(ProCheckRecord proCheckRecord) {
|
||||||
|
return proCheckRecordMapper.update(proCheckRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public int deleteProCheckRecordByIds(Integer[] recordIds) {
|
||||||
|
return proCheckRecordMapper.deleteByIds(recordIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public int deleteProCheckRecordById(Integer recordId) {
|
||||||
|
return proCheckRecordMapper.deleteById(recordId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,129 @@
|
|||||||
|
<?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.technology.mapper.ProCheckRecordMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.op.technology.domain.ProCheckRecord" id="ProCheckRecordResult">
|
||||||
|
<id property="recordId" column="record_id"/>
|
||||||
|
<result property="recordTime" column="record_time"/>
|
||||||
|
<result property="recordPerson" column="record_person"/>
|
||||||
|
<result property="abnoStatus" column="abno_status"/>
|
||||||
|
<result property="isDel" column="is_del"/>
|
||||||
|
<result property="recordPersonName" column="record_person_name"/>
|
||||||
|
<collection property="details"
|
||||||
|
ofType="com.op.technology.domain.ProCheckRecordDetail"
|
||||||
|
select="selectDetailsByRecordId"
|
||||||
|
column="record_id"
|
||||||
|
fetchType="eager"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="DetailResult" type="com.op.technology.domain.ProCheckRecordDetail">
|
||||||
|
<id property="detailId" column="detail_id"/>
|
||||||
|
<result property="recordId" column="record_id"/>
|
||||||
|
<result property="itemName" column="item_name"/>
|
||||||
|
<result property="checkObject" column="check_object"/>
|
||||||
|
<result property="sortOrder" column="sort_order"/>
|
||||||
|
<result property="checkValue" column="check_value"/>
|
||||||
|
<result property="abnoRemark" column="abnoRemark"/>
|
||||||
|
<result property="isDel" column="is_del"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectDetailsByRecordId" parameterType="Integer" resultMap="DetailResult">
|
||||||
|
select detail_id, record_id, item_name, check_object, sort_order, check_value, abno_remark, is_del
|
||||||
|
from pro_check_record_detail
|
||||||
|
where record_id = #{recordId} and is_del = 0
|
||||||
|
order by sort_order,detail_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<sql id="selectProCheckRecordVo">
|
||||||
|
select t1.record_id,
|
||||||
|
t1.record_time,
|
||||||
|
t1.record_person,
|
||||||
|
t1.abno_status,
|
||||||
|
t1.is_del,
|
||||||
|
t3.nick_name as record_person_name
|
||||||
|
from pro_check_record t1
|
||||||
|
left join lanju_op_cloud.dbo.sys_user t3 on t1.record_person = t3.user_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectById" parameterType="Integer" resultMap="ProCheckRecordResult">
|
||||||
|
<include refid="selectProCheckRecordVo"/>
|
||||||
|
where t1.record_id = #{recordId} and t1.is_del = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectList" parameterType="com.op.technology.domain.ProCheckRecord" resultMap="ProCheckRecordResult">
|
||||||
|
<include refid="selectProCheckRecordVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="recordPerson != null and recordPerson != ''">
|
||||||
|
and t1.record_person = #{recordPerson}
|
||||||
|
</if>
|
||||||
|
<if test="recordPersonName != null and recordPersonName != ''">
|
||||||
|
and t3.nick_name like concat('%', #{recordPersonName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="abnoStatus != null">
|
||||||
|
and t1.abno_status = #{abnoStatus}
|
||||||
|
</if>
|
||||||
|
<if test="recordTime != null">
|
||||||
|
and t1.record_time >= #{recordTime}
|
||||||
|
</if>
|
||||||
|
<if test="details != null">
|
||||||
|
<foreach item="detail" collection="details" open="and t2.detail_id in (" separator="," close=")">
|
||||||
|
#{detail.detailId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<choose>
|
||||||
|
<when test="isDel != null">
|
||||||
|
and t1.is_del = #{isDel}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
and t1.is_del = 0
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</where>
|
||||||
|
order by t1.record_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.op.technology.domain.ProCheckRecord">
|
||||||
|
insert into pro_check_record
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="recordId != null">record_id,</if>
|
||||||
|
<if test="recordTime != null">record_time,</if>
|
||||||
|
<if test="recordPerson != null and recordPerson != ''">record_person,</if>
|
||||||
|
<if test="abnoStatus != null">abno_status,</if>
|
||||||
|
<if test="isDel != null">is_del,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="recordId != null">#{recordId},</if>
|
||||||
|
<if test="recordTime != null">#{recordTime},</if>
|
||||||
|
<if test="recordPerson != null and recordPerson != ''">#{recordPerson},</if>
|
||||||
|
<if test="abnoStatus != null">#{abnoStatus},</if>
|
||||||
|
<choose>
|
||||||
|
<when test="isDel != null">#{isDel},</when>
|
||||||
|
<otherwise>0,</otherwise>
|
||||||
|
</choose>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.op.technology.domain.ProCheckRecord">
|
||||||
|
update pro_check_record
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="recordTime != null">record_time = #{recordTime},</if>
|
||||||
|
<if test="recordPerson != null">record_person = #{recordPerson},</if>
|
||||||
|
<if test="abnoStatus != null">abno_status = #{abnoStatus},</if>
|
||||||
|
<if test="isDel != null">is_del = #{isDel},</if>
|
||||||
|
</trim>
|
||||||
|
where record_id = #{recordId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteById" parameterType="Integer">
|
||||||
|
update pro_check_record set is_del = 1 where record_id = #{recordId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteByIds" parameterType="Integer[]">
|
||||||
|
update pro_check_record set is_del = 1 where record_id in
|
||||||
|
<foreach item="recordId" collection="recordIds" open="(" separator="," close=")">
|
||||||
|
#{recordId}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue