28 changed files with 1886 additions and 36 deletions
@ -0,0 +1,143 @@ |
|||
package com.kms.yxgh.sz.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.kms.yxgh.base.SyBaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 缺陷记录 bs_sgc_sz_xcqx |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@TableName("bs_sgc_sz_xcqx") |
|||
@Data |
|||
@ApiModel("缺陷记录") |
|||
public class SzCheckingProblemV2 extends SyBaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String itemId; |
|||
|
|||
/** |
|||
* 问题位置 |
|||
*/ |
|||
@ApiModelProperty("部位") |
|||
private String parts; |
|||
|
|||
|
|||
@ApiModelProperty("问题等级") |
|||
private String problemLevel; |
|||
|
|||
/** |
|||
* 项目id |
|||
*/ |
|||
@ApiModelProperty("项目id") |
|||
private String checkingId; |
|||
|
|||
/** |
|||
* 记录id |
|||
*/ |
|||
@ApiModelProperty("记录id") |
|||
private String recordId; |
|||
|
|||
|
|||
/** |
|||
* 巡查状态字典:patrol_maintenance_status |
|||
*/ |
|||
@ApiModelProperty("巡查状态字典:patrol_maintenance_status") |
|||
private String status; |
|||
|
|||
|
|||
/** |
|||
* 巡查项目名称 |
|||
*/ |
|||
@ApiModelProperty("巡查项目名称") |
|||
private String checkingName; |
|||
|
|||
|
|||
/** |
|||
* 巡查类型 字典:patrol_maintenance_type |
|||
*/ |
|||
@ApiModelProperty("巡查类型 字典:patrol_maintenance_type") |
|||
private String type; |
|||
|
|||
/** |
|||
* 巡查类别字典:key_jf_patrol_category |
|||
*/ |
|||
@ApiModelProperty("巡查类别字典:patrol_maintenance_category") |
|||
private String category; |
|||
|
|||
|
|||
/** |
|||
* 巡查责任人 |
|||
*/ |
|||
@ApiModelProperty("巡查责任人") |
|||
private String dutyHolderName; |
|||
|
|||
/** |
|||
* 巡查责任人id |
|||
*/ |
|||
@ApiModelProperty("巡查责任人id") |
|||
private String dutyHolderId; |
|||
|
|||
/** |
|||
* 堤防代码 |
|||
*/ |
|||
@ApiModelProperty("堤防代码") |
|||
private String wagaCode; |
|||
|
|||
|
|||
/** |
|||
* 堤防代码名称 |
|||
*/ |
|||
@ApiModelProperty("堤防代码名称") |
|||
private String wagaName; |
|||
|
|||
/** |
|||
* 巡查开始时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("巡查开始时间") |
|||
private Date startDate; |
|||
|
|||
/** |
|||
* 巡查开始时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("巡查结束时间") |
|||
private Date endDate; |
|||
|
|||
/** |
|||
* 问题位置 |
|||
*/ |
|||
@ApiModelProperty("问题位置") |
|||
private String position; |
|||
|
|||
@ApiModelProperty("检查内容") |
|||
private String content; |
|||
/** |
|||
* 文档 |
|||
*/ |
|||
@ApiModelProperty("文档") |
|||
private String doc; |
|||
|
|||
/** |
|||
* 创建人id |
|||
*/ |
|||
@ApiModelProperty("创建人id") |
|||
private String createUid; |
|||
|
|||
|
|||
/** |
|||
* 附加配置 |
|||
*/ |
|||
@ApiModelProperty("备注") |
|||
private String remark; |
|||
|
|||
|
|||
} |
@ -0,0 +1,121 @@ |
|||
package com.kms.yxgh.sz.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.kms.yxgh.base.SyBaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* bs_sgc_df_xsxcjl |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@TableName("bs_sgc_sz_xsxcjl") |
|||
@Data |
|||
@ApiModel("水闸项目管理记录") |
|||
public class SzCheckingRecord extends SyBaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 开始时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("开始时间") |
|||
private Date startDate; |
|||
|
|||
/** |
|||
* 结束时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("结束时间") |
|||
private Date endDate; |
|||
|
|||
/** |
|||
* 巡查范围 |
|||
*/ |
|||
@ApiModelProperty("巡查范围") |
|||
private String scope; |
|||
|
|||
|
|||
/** |
|||
* 项目id |
|||
*/ |
|||
@ApiModelProperty("项目id") |
|||
private String checkingId; |
|||
|
|||
/** |
|||
* 巡查状态字典:patrol_maintenance_status |
|||
*/ |
|||
@ApiModelProperty("巡查状态字典:patrol_maintenance_status") |
|||
private String status; |
|||
|
|||
/** |
|||
* 巡查责任人 |
|||
*/ |
|||
@ApiModelProperty("巡查责任人") |
|||
private String dutyHolderName; |
|||
|
|||
/** |
|||
* 巡查责任人id |
|||
*/ |
|||
@ApiModelProperty("巡查责任人id") |
|||
private String dutyHolderId; |
|||
|
|||
/** |
|||
* 项目名称 |
|||
*/ |
|||
@ApiModelProperty("项目名称") |
|||
private String checkingName; |
|||
|
|||
/** |
|||
* 巡查类型 字典:patrol_maintenance_type |
|||
*/ |
|||
@ApiModelProperty("巡查类型 字典:patrol_maintenance_type") |
|||
private String type; |
|||
|
|||
/** |
|||
* 巡查类别字典:key_jf_patrol_category |
|||
*/ |
|||
@ApiModelProperty("巡查类别字典:patrol_maintenance_category") |
|||
private String category; |
|||
|
|||
/** |
|||
* 堤防代码 |
|||
*/ |
|||
@ApiModelProperty("水闸代码") |
|||
private String wagaCode; |
|||
|
|||
|
|||
/** |
|||
* 堤防代码名称 |
|||
*/ |
|||
@ApiModelProperty("水闸代码名称") |
|||
private String wagaName; |
|||
|
|||
|
|||
/** |
|||
* 创建人id |
|||
*/ |
|||
@ApiModelProperty("创建人id") |
|||
private String createUid; |
|||
|
|||
|
|||
/** |
|||
* 附加配置 |
|||
*/ |
|||
@ApiModelProperty("备注") |
|||
private String remark; |
|||
|
|||
/** |
|||
* 创建人名称 |
|||
*/ |
|||
@ApiModelProperty("创建人名称") |
|||
private String createName; |
|||
|
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.kms.yxgh.sz.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.kms.yxgh.base.SyBaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 水闸项目管理子项 |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@TableName("bs_sgc_sz_xcitem") |
|||
@Data |
|||
@ApiModel("水闸项目管理子项") |
|||
public class SzCheckingV2ProjectItem extends SyBaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 项目id |
|||
*/ |
|||
@ApiModelProperty("项目id") |
|||
private String checkingId; |
|||
|
|||
/** |
|||
* 检查部位 |
|||
*/ |
|||
@ApiModelProperty("检查部位") |
|||
private String parts; |
|||
|
|||
/** |
|||
* 检查内容 |
|||
*/ |
|||
@ApiModelProperty("检查内容") |
|||
private String content; |
|||
|
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
package com.kms.yxgh.sz.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.kms.yxgh.base.SyBaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* bs_sgc_df_hdjh |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@TableName("bs_sgc_sz_xmgl") |
|||
@Data |
|||
@ApiModel("水闸项目管理") |
|||
public class SzCheckingV2ProjectManage extends SyBaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 堤防代码 |
|||
*/ |
|||
@ApiModelProperty("水闸代码") |
|||
private String wagaCode; |
|||
|
|||
|
|||
/** |
|||
* 堤防代码名称 |
|||
*/ |
|||
@ApiModelProperty("水闸代码名称") |
|||
private String wagaName; |
|||
|
|||
/** |
|||
* 项目名称 |
|||
*/ |
|||
@ApiModelProperty("项目名称") |
|||
private String name; |
|||
|
|||
|
|||
/** |
|||
* 巡查类型 字典:patrol_maintenance_type |
|||
*/ |
|||
@ApiModelProperty("巡查类型 字典:patrol_maintenance_type") |
|||
private String type; |
|||
|
|||
|
|||
/** |
|||
* 巡查类别字典:key_jf_patrol_category |
|||
*/ |
|||
@ApiModelProperty("巡查类别字典:patrol_maintenance_category") |
|||
private String category; |
|||
|
|||
/** |
|||
* 附加配置 |
|||
*/ |
|||
@ApiModelProperty("备注") |
|||
private String remark; |
|||
|
|||
/** |
|||
* 创建人名称 |
|||
*/ |
|||
@ApiModelProperty("创建人名称") |
|||
private String createName; |
|||
|
|||
|
|||
} |
@ -0,0 +1,136 @@ |
|||
package com.kms.yxgh.sz.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.kms.yxgh.base.SyBaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 缺陷记录 bs_sgc_df_xcqx |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@TableName("bs_sgc_sz_xcyj") |
|||
@Data |
|||
@ApiModel("水闸巡视养护管理表") |
|||
public class SzYhV2 extends SyBaseEntity { |
|||
|
|||
/** |
|||
* 巡查项目id |
|||
*/ |
|||
@ApiModelProperty("巡查项目id") |
|||
private String checkingId; |
|||
/** |
|||
* 缺陷id |
|||
*/ |
|||
@ApiModelProperty("缺陷id") |
|||
private String problemId; |
|||
/** |
|||
* 文档 |
|||
*/ |
|||
@ApiModelProperty("文档") |
|||
private String doc; |
|||
|
|||
|
|||
/** |
|||
* 维养责任人id |
|||
*/ |
|||
@ApiModelProperty("维养责任人id") |
|||
private String dutyHolderId; |
|||
|
|||
/** |
|||
* 维养责任人名称 |
|||
*/ |
|||
@ApiModelProperty("维养责任人名称") |
|||
private String dutyHolderName; |
|||
|
|||
|
|||
/** |
|||
* 问题等级 |
|||
*/ |
|||
@ApiModelProperty("水闸问题等级") |
|||
private String problemLevel; |
|||
|
|||
|
|||
/** |
|||
* 记录id |
|||
*/ |
|||
@ApiModelProperty("记录id") |
|||
private String recordId; |
|||
|
|||
/** |
|||
* 巡查状态字典:patrol_maintenance_status |
|||
*/ |
|||
@ApiModelProperty("巡查状态字典:patrol_maintenance_status") |
|||
private String status; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
@ApiModelProperty("名称") |
|||
private String name; |
|||
|
|||
/** |
|||
* 巡查类型 字典:patrol_maintenance_type |
|||
*/ |
|||
@ApiModelProperty("巡查类型 字典:patrol_maintenance_type") |
|||
private String type; |
|||
|
|||
/** |
|||
* 巡查类别字典:key_jf_patrol_category |
|||
*/ |
|||
@ApiModelProperty("巡查类别字典:patrol_maintenance_category") |
|||
private String category; |
|||
|
|||
/** |
|||
* 堤防代码 |
|||
*/ |
|||
@ApiModelProperty("堤防代码") |
|||
private String wagaCode; |
|||
|
|||
|
|||
/** |
|||
* 堤防代码名称 |
|||
*/ |
|||
@ApiModelProperty("水闸代码名称") |
|||
private String wagaName; |
|||
|
|||
/** |
|||
* 维养开始时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("维养开始时间") |
|||
private Date startDate; |
|||
|
|||
/** |
|||
* 维养结束时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("维养结束时间") |
|||
private Date endDate; |
|||
|
|||
|
|||
/** |
|||
* 创建人id |
|||
*/ |
|||
@ApiModelProperty("创建人id") |
|||
private String createUid; |
|||
|
|||
|
|||
/** |
|||
* 附加配置 |
|||
*/ |
|||
@ApiModelProperty("备注") |
|||
private String remark; |
|||
|
|||
|
|||
private String content; |
|||
|
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.kms.yxgh.sz.dto.v2; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
@ApiModel(value = "水闸养护验收列表信息v2") |
|||
@Data |
|||
public class SzYhApproveDto extends SzV2CheckingDto { |
|||
|
|||
@ApiModelProperty("巡查责任人") |
|||
private String dutyHolderId; |
|||
|
|||
@ApiModelProperty("巡查责任人名称") |
|||
private String dutyHolderName; |
|||
|
|||
@ApiModelProperty("问题级别") |
|||
private String problemLevel; |
|||
|
|||
@ApiModelProperty("记录id") |
|||
private String recordId; |
|||
@ApiModelProperty("问题id") |
|||
private String problemId; |
|||
@ApiModelProperty("状态") |
|||
private String status; |
|||
} |
@ -0,0 +1,80 @@ |
|||
package com.kms.yxgh.sz.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.yxgh.common.dto.CountDateDto; |
|||
import com.kms.yxgh.common.dto.CountDto; |
|||
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; |
|||
import com.kms.yxgh.common.enums.PatrolMaintenanceCategory; |
|||
import com.kms.yxgh.sz.domain.SzCheckingProblemV2; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* SzCheckingProblemV2Mapper |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@Repository |
|||
public interface SzCheckingProblemV2Mapper extends BaseMapper<SzCheckingProblemV2> { |
|||
|
|||
@Select("<script> " + |
|||
"select base.adcd code ,count(1) sum " + |
|||
"from bs_sgc_sz_xcqx xm " + |
|||
"left join att_dike_base base on base.dike_code=xm.waga_code " + |
|||
"where 1=1 " + |
|||
"<if test='data.startTime != null'> and xm.create_time >= #{data.startTime} </if> " + |
|||
"<if test='data.endTime != null'> and xm.create_time <= #{data.endTime} </if> " + |
|||
"<if test='data.adcdQx != null and data.adcdQx != \"\"'>" + |
|||
"and base.adcd like concat(#{data.adcdQx}, '%') " + |
|||
"</if>" + |
|||
"group by base.adcd " + |
|||
"</script>") |
|||
List<CountDto> count(@Param("data") ObjectStatisticQueDto sp); |
|||
|
|||
|
|||
@Select("<script> " + |
|||
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_sz_xcqx where 1=1 " + |
|||
"<if test='data.startTime != null'> and create_time >= #{data.startTime} </if> " + |
|||
"<if test='data.endTime != null'> and create_time <= #{data.endTime} </if> " + |
|||
"<if test='data.code != null and data.code != \"\"'>" + |
|||
"and dike_code = #{data.code} " + |
|||
"</if>" + |
|||
"<if test='category != null'>" + |
|||
"and category = #{category.value} " + |
|||
"</if>" + |
|||
"group by DATE_FORMAT(create_time, '%Y-%m-%d') " + |
|||
"</script>") |
|||
List<CountDateDto> countDate(@Param("data") ObjectStatisticQueDto sp, @Param("category") PatrolMaintenanceCategory category); |
|||
|
|||
|
|||
@Select("<script> " + |
|||
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_sz_xcqx where 1=1 " + |
|||
"<if test='data.startTime != null'> and create_time >= #{data.startTime} </if> " + |
|||
"<if test='data.endTime != null'> and create_time <= #{data.endTime} </if> " + |
|||
"<if test='data.code != null and data.code != \"\"'>" + |
|||
"and dike_code = #{data.code} " + |
|||
"</if>" + |
|||
"<if test='category != null'>" + |
|||
"and category = #{category.value} " + |
|||
"</if>" + |
|||
"group by DATE_FORMAT(create_time, '%Y-%m-%d') " + |
|||
"</script>") |
|||
List<CountDateDto> countLevel(@Param("data") ObjectStatisticQueDto sp, @Param("category") PatrolMaintenanceCategory category); |
|||
|
|||
|
|||
@Select("<script> " + |
|||
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_sz_xcqx where 1=1 " + |
|||
"<if test='data.startTime != null'> and xm.create_time >= #{data.startTime} </if> " + |
|||
"<if test='data.endTime != null'> and xm.create_time <= #{data.endTime} </if> " + |
|||
"<if test='data.code != null and data.code != \"\"'>" + |
|||
"and dike_code = #{data.code} " + |
|||
"</if>" + |
|||
"group by DATE_FORMAT(create_time, '%Y-%m-%d') " + |
|||
"</script>") |
|||
List<CountDateDto> countQx(@Param("data") ObjectStatisticQueDto sp); |
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
package com.kms.yxgh.sz.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.yxgh.common.dto.CountDateDto; |
|||
import com.kms.yxgh.common.dto.CountDto; |
|||
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; |
|||
import com.kms.yxgh.common.enums.PatrolMaintenanceCategory; |
|||
import com.kms.yxgh.df.domain.DfCheckingRecord; |
|||
import com.kms.yxgh.sz.domain.SzCheckingRecord; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 害堤动物防治计划Mapper接口 |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@Repository |
|||
public interface SzCheckingRecordV2Mapper extends BaseMapper<SzCheckingRecord> { |
|||
|
|||
@Select("<script> " + |
|||
"select base.adcd code ,count(1) sum " + |
|||
"from bs_sgc_sz_xsxcjl xm " + |
|||
"left join att_dike_base base on base.dike_code=xm.waga_code " + |
|||
"where 1=1 " + |
|||
"<if test='data.startTime != null'> and xm.create_time >= #{data.startTime} </if> " + |
|||
"<if test='data.endTime != null'> and xm.create_time <= #{data.endTime} </if> " + |
|||
"<if test='data.adcdQx != null and data.adcdQx != \"\"'>" + |
|||
"and base.adcd like concat(#{data.adcdQx}, '%') " + |
|||
"</if>" + |
|||
"<if test='category != null'>" + |
|||
"and xm.category = #{category.value} " + |
|||
"</if>" + |
|||
"group by base.adcd " + |
|||
"</script>") |
|||
List<CountDto> count(@Param("data") ObjectStatisticQueDto sp, @Param("category") PatrolMaintenanceCategory category); |
|||
|
|||
|
|||
@Select("<script> " + |
|||
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_sz_xsxcjl where 1=1 " + |
|||
"<if test='data.startTime != null' > and create_time >= #{data.startTime} </if> " + |
|||
"<if test='data.endTime != null'> and create_time <= #{data.endTime} </if> " + |
|||
"<if test='data.code != null and data.code != \"\"'>" + |
|||
"and dike_code = #{data.code} " + |
|||
"</if>" + |
|||
"<if test='category != null'>" + |
|||
"and category = #{category.value} " + |
|||
"</if>" + |
|||
"group by DATE_FORMAT(create_time, '%Y-%m-%d') " + |
|||
"</script>") |
|||
List<CountDateDto> countDateGroup(@Param("data") ObjectStatisticQueDto sp, @Param("category") PatrolMaintenanceCategory category); |
|||
|
|||
@Select("<script> " + |
|||
"select count(distinct waga_code) from bs_sgc_sz_xsxcjl " + |
|||
"<if test='data.startTime != null' > and create_time >= #{data.startTime} </if> " + |
|||
"<if test='data.endTime != null'> and create_time <= #{data.endTime} </if> " + |
|||
"<if test='data.code != null and data.code != \"\"'>" + |
|||
"and waga_code = #{data.code} " + |
|||
"</if>" + |
|||
"</script>" |
|||
) |
|||
int countXm(@Param("data") ObjectStatisticQueDto sp); |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.kms.yxgh.sz.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.yxgh.common.dto.CountDto; |
|||
import com.kms.yxgh.common.dto.ObjectStatisticQueDto; |
|||
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectManage; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* SzCheckingV2Mapper |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@Repository |
|||
public interface SzCheckingV2Mapper extends BaseMapper<SzCheckingV2ProjectManage> { |
|||
|
|||
@Select("<script> " + |
|||
"select base.adcd code ,count(1) sum " + |
|||
"from bs_sgc_sz_xmgl xm " + |
|||
"left join att_dike_base base on base.dike_code=xm.waga_code " + |
|||
"where 1=1 " + |
|||
"<if test='data.adcdQx != null and data.adcdQx != \"\"'>" + |
|||
"and base.adcd like concat(#{data.adcdQx}, '%') " + |
|||
"</if>" + |
|||
"group by base.adcd " + |
|||
"</script>" |
|||
) |
|||
List<CountDto> count(@Param("data") ObjectStatisticQueDto sp); |
|||
|
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.kms.yxgh.sz.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.yxgh.df.domain.DfCheckingV2ProjectItem; |
|||
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectItem; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
/** |
|||
* SzCheckingV2ProjectItemMapper |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@Repository |
|||
public interface SzCheckingV2ProjectItemMapper extends BaseMapper<SzCheckingV2ProjectItem> { |
|||
|
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
package com.kms.yxgh.sz.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.kms.yxgh.common.dto.*; |
|||
import com.kms.yxgh.sz.domain.SzYhV2; |
|||
import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto; |
|||
import com.kms.yxgh.sz.dto.v2.SzYhApproveDto; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* DfYhV2Mapper |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@Repository |
|||
public interface SzYhV2Mapper extends BaseMapper<SzYhV2> { |
|||
|
|||
IPage<ApprovalDetailDto<SzYhApproveDto>> approvalSearchPage(Page<SzRecordSearchV2Dto> page, @Param("dto") ApprovalSearchDto<SzRecordSearchV2Dto> data); |
|||
|
|||
|
|||
@Select("<script> " + |
|||
"select base.adcd code ,count(1) sum " + |
|||
"from bs_sgc_sz_xcyj xm " + |
|||
"left join att_dike_base base on base.dike_code=xm.waga_code " + |
|||
"where 1=1 " + |
|||
"<if test='data.startTime != null'> and xm.create_time >= #{data.startTime} </if> " + |
|||
"<if test='data.endTime != null'> and xm.create_time <= #{data.endTime} </if> " + |
|||
"<if test='data.adcdQx != null and data.adcdQx != \"\"'>" + |
|||
"and base.adcd like concat(#{data.adcdQx}, '%') " + |
|||
"</if>" + |
|||
"group by base.adcd " + |
|||
"</script>") |
|||
List<CountDto> count(@Param("data") ObjectStatisticQueDto sp); |
|||
|
|||
|
|||
@Select("<script> " + |
|||
"select DATE_FORMAT(create_time, '%Y-%m-%d') as myDate,count(*) as mySum from bs_sgc_sz_xcyj where 1=1 " + |
|||
"<if test='data.startTime != null'> and create_time >= #{data.startTime} </if> " + |
|||
"<if test='data.endTime != null'> and create_time <= #{data.endTime} </if> " + |
|||
"<if test='data.code != null and data.code != \"\"'>" + |
|||
"and dike_code = #{data.code} " + |
|||
"</if>" + |
|||
"group by DATE_FORMAT(create_time, '%Y-%m-%d') " + |
|||
"</script>") |
|||
List<CountDateDto> countYhDto(@Param("data") ObjectStatisticQueDto sp); |
|||
} |
@ -0,0 +1,111 @@ |
|||
|
|||
package com.kms.yxgh.sz.service; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.kms.yxgh.df.domain.DfCheckingProblemV2; |
|||
import com.kms.yxgh.df.dto.v2.DfProblemV2Dto; |
|||
import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto; |
|||
import com.kms.yxgh.sz.domain.SzCheckingProblemV2; |
|||
import com.kms.yxgh.sz.dto.v2.SzProblemV2Dto; |
|||
import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto; |
|||
import com.kms.yxgh.sz.mapper.SzCheckingProblemV2Mapper; |
|||
import com.shuili.common.core.domain.SearchParam; |
|||
import com.shuili.common.core.service.BaseService; |
|||
import com.shuili.common.utils.BeanUtils; |
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Objects; |
|||
import java.util.Optional; |
|||
import java.util.stream.Collectors; |
|||
|
|||
import static com.kms.yxgh.common.enums.DfYhV2StatusEnum.DURING_INSPECTION; |
|||
|
|||
/** |
|||
* 项目管理记录 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SzCheckingProblemV2Service extends BaseService<SzCheckingProblemV2Mapper, SzCheckingProblemV2> { |
|||
|
|||
|
|||
public IPage<SzProblemV2Dto> list(SearchParam<SzRecordSearchV2Dto> sp) { |
|||
// 分页参数
|
|||
Page<SzCheckingProblemV2> page = new Page<>(sp.getPageNum(), sp.getPageSize()); |
|||
SzRecordSearchV2Dto data = sp.getData(); |
|||
|
|||
// 构建查询条件
|
|||
LambdaQueryWrapper<SzCheckingProblemV2> queryWrapper = new LambdaQueryWrapper<SzCheckingProblemV2>(); |
|||
if (!ObjectUtils.isEmpty(data)) { |
|||
Optional.ofNullable(data.getCategory()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(category -> queryWrapper.eq(SzCheckingProblemV2::getCategory, category)); |
|||
|
|||
Optional.ofNullable(data.getType()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(type -> queryWrapper.eq(SzCheckingProblemV2::getType, type)); |
|||
|
|||
Optional.ofNullable(data.getName()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(name -> queryWrapper.like(SzCheckingProblemV2::getCheckingName, name)); |
|||
|
|||
Optional.ofNullable(data.getDutyHolder()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(dutyHolder -> queryWrapper.like(SzCheckingProblemV2::getDutyHolderName, dutyHolder)); |
|||
|
|||
Optional.ofNullable(data.getStatus()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(status -> queryWrapper.like(SzCheckingProblemV2::getStatus, status)); |
|||
|
|||
if (!Objects.isNull(data.getStartDate())) { |
|||
queryWrapper.ge(SzCheckingProblemV2::getStartDate, data.getStartDate()); |
|||
} |
|||
|
|||
if (!Objects.isNull(data.getEndDate())) { |
|||
queryWrapper.le(SzCheckingProblemV2::getEndDate, data.getEndDate()); |
|||
} |
|||
Optional.ofNullable(data.getProblemLevel()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(problemLevel -> queryWrapper.eq(SzCheckingProblemV2::getProblemLevel, problemLevel)); |
|||
|
|||
Optional.ofNullable(data.getRecordId()) |
|||
.filter(StringUtils::isBlank) |
|||
.ifPresent(recordId -> queryWrapper.eq(SzCheckingProblemV2::getProblemLevel, recordId)); |
|||
|
|||
} |
|||
queryWrapper.ne(SzCheckingProblemV2::getStatus, DURING_INSPECTION.getValue()); |
|||
|
|||
// 查询分页数据
|
|||
Page<SzCheckingProblemV2> queryPage = page(page, queryWrapper); |
|||
if (queryPage == null) { |
|||
return new Page<>(); |
|||
} |
|||
|
|||
// 转换为 DTO 分页对象
|
|||
Page<SzProblemV2Dto> dtoPage = new Page<>(); |
|||
BeanUtils.copyProperties(queryPage, dtoPage); |
|||
|
|||
// 处理查询结果
|
|||
List<SzProblemV2Dto> vos = queryPage.getRecords().stream() |
|||
.map(record -> { |
|||
SzProblemV2Dto dto = new SzProblemV2Dto(); |
|||
BeanUtils.copyProperties(record, dto); |
|||
return dto; |
|||
}) |
|||
.collect(Collectors.toList()); |
|||
dtoPage.setRecords(vos); |
|||
return dtoPage; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,257 @@ |
|||
package com.kms.yxgh.sz.service; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.kms.yxgh.common.enums.DfYhV2StatusEnum; |
|||
import com.kms.yxgh.df.service.DfCheckingV2Service; |
|||
import com.kms.yxgh.sz.domain.SzCheckingProblemV2; |
|||
import com.kms.yxgh.sz.domain.SzCheckingRecord; |
|||
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectItem; |
|||
import com.kms.yxgh.sz.domain.SzYhV2; |
|||
import com.kms.yxgh.sz.dto.v2.SzRecordDetailV2Dto; |
|||
import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto; |
|||
import com.kms.yxgh.sz.mapper.SzCheckingRecordV2Mapper; |
|||
import com.shuili.common.core.domain.SearchParam; |
|||
import com.shuili.common.core.service.BaseService; |
|||
import com.shuili.common.utils.BeanUtils; |
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Objects; |
|||
import java.util.Optional; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 水闸项目管理记录 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SzCheckingRecordV2Service extends BaseService<SzCheckingRecordV2Mapper, SzCheckingRecord> { |
|||
|
|||
private final SzYhV2Service szYhV2Service; |
|||
|
|||
|
|||
private final SzCheckingV2ProjectItemV2Service szCheckingV2ProjectItemV2Service; |
|||
|
|||
private final SzCheckingProblemV2Service szCheckingProblemV2Service; |
|||
|
|||
public IPage<SzRecordDetailV2Dto> list(SearchParam<SzRecordSearchV2Dto> sp) { |
|||
// 分页参数
|
|||
Page<SzCheckingRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize()); |
|||
SzRecordSearchV2Dto data = sp.getData(); |
|||
|
|||
// 构建查询条件
|
|||
LambdaQueryWrapper<SzCheckingRecord> queryWrapper = new LambdaQueryWrapper<>(); |
|||
if (!ObjectUtils.isEmpty(data)) { |
|||
Optional.ofNullable(data.getCategory()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(category -> queryWrapper.eq(SzCheckingRecord::getCategory, category)); |
|||
|
|||
Optional.ofNullable(data.getType()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(type -> queryWrapper.eq(SzCheckingRecord::getType, type)); |
|||
|
|||
Optional.ofNullable(data.getName()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(name -> queryWrapper.like(SzCheckingRecord::getCheckingName, name)); |
|||
|
|||
Optional.ofNullable(data.getDutyHolder()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(dutyHolder -> queryWrapper.like(SzCheckingRecord::getDutyHolderName, dutyHolder)); |
|||
|
|||
Optional.ofNullable(data.getStatus()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(status -> queryWrapper.like(SzCheckingRecord::getStatus, status)); |
|||
|
|||
|
|||
if (!Objects.isNull(data.getStartDate())) { |
|||
queryWrapper.ge(SzCheckingRecord::getStartDate, data.getStartDate()); |
|||
} |
|||
|
|||
if (!Objects.isNull(data.getEndDate())) { |
|||
queryWrapper.le(SzCheckingRecord::getEndDate, data.getEndDate()); |
|||
} |
|||
} |
|||
|
|||
// 查询分页数据
|
|||
Page<SzCheckingRecord> queryPage = page(page, queryWrapper); |
|||
if (queryPage == null) { |
|||
return new Page<>(); |
|||
} |
|||
|
|||
// 转换为 DTO 分页对象
|
|||
Page<SzRecordDetailV2Dto> dtoPage = new Page<>(); |
|||
BeanUtils.copyProperties(queryPage, dtoPage); |
|||
|
|||
// 处理查询结果
|
|||
List<SzRecordDetailV2Dto> vos = queryPage.getRecords().stream() |
|||
.map(record -> { |
|||
SzRecordDetailV2Dto dto = new SzRecordDetailV2Dto(); |
|||
BeanUtils.copyProperties(record, dto); |
|||
return dto; |
|||
}) |
|||
.collect(Collectors.toList()); |
|||
dtoPage.setRecords(vos); |
|||
return dtoPage; |
|||
|
|||
} |
|||
|
|||
|
|||
public SzRecordDetailV2Dto getInfo(String id) { |
|||
SzRecordDetailV2Dto dto = new SzRecordDetailV2Dto(); |
|||
SzCheckingRecord szCheckingRecord = getById(id); |
|||
if (szCheckingRecord == null) { |
|||
return dto; |
|||
} |
|||
BeanUtils.copyProperties(szCheckingRecord, dto); |
|||
|
|||
|
|||
List<SzCheckingV2ProjectItem> items = szCheckingV2ProjectItemV2Service.list(new LambdaQueryWrapper<SzCheckingV2ProjectItem>() |
|||
.eq(SzCheckingV2ProjectItem::getCheckingId,szCheckingRecord.getCheckingId())); |
|||
|
|||
|
|||
|
|||
dto.setItems(items.stream() |
|||
.map(SzCheckingV2Service::convertToItemDto) |
|||
.collect(Collectors.toList())); |
|||
|
|||
|
|||
List<SzCheckingProblemV2> recordsList = szCheckingProblemV2Service.list(new LambdaQueryWrapper<SzCheckingProblemV2>() |
|||
.eq(SzCheckingProblemV2::getRecordId, szCheckingRecord.getId())); |
|||
List<SzRecordDetailV2Dto.SzRecordItemDetailV2Dto> dtoList = new ArrayList<>(); |
|||
for (SzCheckingProblemV2 record : recordsList) { |
|||
SzRecordDetailV2Dto.SzRecordItemDetailV2Dto detailV2Dto = new SzRecordDetailV2Dto.SzRecordItemDetailV2Dto(); |
|||
if (null != record.getParts()) { |
|||
detailV2Dto.setParts(DfCheckingV2Service.getStringList(record.getParts().split(","))); |
|||
} |
|||
if (null != record.getDoc()) { |
|||
detailV2Dto.setProblemImages(DfCheckingV2Service.getStringList(record.getDoc().split(","))); |
|||
} |
|||
detailV2Dto.setItemId(record.getItemId()); |
|||
detailV2Dto.setId(record.getId()); |
|||
detailV2Dto.setPosition(record.getPosition()); |
|||
detailV2Dto.setContent(record.getContent()); |
|||
detailV2Dto.setProblemLevel(record.getProblemLevel()); |
|||
detailV2Dto.setStatus(record.getStatus()); |
|||
dtoList.add(detailV2Dto); |
|||
} |
|||
dto.setProblems(dtoList); |
|||
return dto; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public SzRecordDetailV2Dto edit(SzRecordDetailV2Dto szRecord, Boolean commit) { |
|||
// 先删后加
|
|||
myRemovePraIds(szRecord); |
|||
if (commit) { |
|||
SzCheckingRecord szCheckingRecord = new SzCheckingRecord(); |
|||
BeanUtils.copyProperties(szRecord, szCheckingRecord); |
|||
// 提交为已巡检
|
|||
szCheckingRecord.setStatus(DfYhV2StatusEnum.INSPECTED.getValue()); |
|||
// 如果相关缺陷大于一条就是养护中
|
|||
if (!szRecord.getProblems().isEmpty()) { |
|||
szCheckingRecord.setStatus(DfYhV2StatusEnum.UNDER_MAINTENANCE.getValue()); |
|||
} else { |
|||
// 提交时缺陷无数据就是无缺陷
|
|||
szCheckingRecord.setStatus(DfYhV2StatusEnum.NO_DEFECTS.getValue()); |
|||
} |
|||
mySaveOrUpdate(szCheckingRecord); |
|||
szRecord.setStatus(szCheckingRecord.getStatus()); |
|||
szRecord.setRecordId(szCheckingRecord.getId()); |
|||
szCheckingProblemV2Service.saveOrUpdateBatch(convertToImages(szRecord)); |
|||
return szRecord; |
|||
} else { |
|||
SzCheckingRecord szCheckingRecord = new SzCheckingRecord(); |
|||
BeanUtils.copyProperties(szRecord, szCheckingRecord); |
|||
// 未提交维巡查中
|
|||
szCheckingRecord.setStatus(DfYhV2StatusEnum.DURING_INSPECTION.getValue()); |
|||
mySaveOrUpdate(szCheckingRecord); |
|||
szRecord.setStatus(DfYhV2StatusEnum.DURING_INSPECTION.getValue()); |
|||
szRecord.setRecordId(szCheckingRecord.getId()); |
|||
szCheckingProblemV2Service.saveOrUpdateBatch(convertToImages(szRecord)); |
|||
return szRecord; |
|||
} |
|||
} |
|||
|
|||
public void mySaveOrUpdate (SzCheckingRecord szCheckingRecord) { |
|||
Boolean flag = org.springframework.util.StringUtils.isEmpty(szCheckingRecord.getId()) ? Boolean.TRUE :Boolean.FALSE; |
|||
if (flag) { |
|||
save(szCheckingRecord); |
|||
}else { |
|||
updateById(szCheckingRecord); |
|||
} |
|||
} |
|||
|
|||
public void myRemovePraIds(SzRecordDetailV2Dto dfRecord) { |
|||
List<String> ids = dfRecord.getProblems() |
|||
.stream() |
|||
.map(SzRecordDetailV2Dto.SzRecordItemDetailV2Dto::getId).collect(Collectors.toList()); |
|||
if (CollectionUtils.isNotEmpty(ids)) { |
|||
szCheckingProblemV2Service.remove(new LambdaQueryWrapper<SzCheckingProblemV2>().in(SzCheckingProblemV2::getId, ids)); |
|||
szYhV2Service.remove(new LambdaQueryWrapper<SzYhV2>().in(SzYhV2::getProblemId, ids)); |
|||
} |
|||
} |
|||
|
|||
public static List<SzCheckingProblemV2> convertToImages(SzRecordDetailV2Dto dfRecord) { |
|||
List<SzCheckingProblemV2> szCheckingProblemV2s = new ArrayList<>(); |
|||
dfRecord.getProblems().forEach(e -> { |
|||
SzCheckingProblemV2 szCheckingProblemV2 = new SzCheckingProblemV2(); |
|||
BeanUtils.copyProperties(e, szCheckingProblemV2); |
|||
szCheckingProblemV2.setCheckingId(dfRecord.getCheckingId()); |
|||
szCheckingProblemV2.setRecordId(dfRecord.getRecordId()); |
|||
szCheckingProblemV2.setCheckingName(dfRecord.getCheckingName()); |
|||
szCheckingProblemV2.setWagaCode(dfRecord.getWagaCode()); |
|||
szCheckingProblemV2.setWagaName(dfRecord.getWagaName()); |
|||
szCheckingProblemV2.setDutyHolderName(dfRecord.getCreateName()); |
|||
szCheckingProblemV2.setDutyHolderId(dfRecord.getCreateUid()); |
|||
szCheckingProblemV2.setStartDate(dfRecord.getStartDate()); |
|||
szCheckingProblemV2.setEndDate(dfRecord.getEndDate()); |
|||
szCheckingProblemV2.setType(dfRecord.getType()); |
|||
szCheckingProblemV2.setCategory(dfRecord.getCategory()); |
|||
szCheckingProblemV2.setStatus(dfRecord.getStatus()); |
|||
szCheckingProblemV2.setItemId(e.getItemId()); |
|||
if (null != e.getParts()) { |
|||
szCheckingProblemV2.setParts(String.join(",", e.getParts())); |
|||
} |
|||
if (null != e.getProblemImages()) { |
|||
szCheckingProblemV2.setDoc(String.join(",", e.getProblemImages())); |
|||
} |
|||
szCheckingProblemV2s.add(szCheckingProblemV2); |
|||
}); |
|||
return szCheckingProblemV2s; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public Boolean myRemove(String[] ids) { |
|||
if (null != ids && ids.length > 0) { |
|||
int count = szCheckingProblemV2Service.count(new LambdaQueryWrapper<SzCheckingProblemV2>() |
|||
.in(SzCheckingProblemV2::getCheckingId |
|||
, SzCheckingV2Service.getIntList(ids)) |
|||
); |
|||
if (count > 0) { |
|||
throw new RuntimeException("请先删除项目子项"); |
|||
} |
|||
szCheckingProblemV2Service.remove(new LambdaQueryWrapper<SzCheckingProblemV2>() |
|||
.in(SzCheckingProblemV2::getCheckingId, SzCheckingV2Service.getIntList(ids))); |
|||
|
|||
return remove(new LambdaQueryWrapper<SzCheckingRecord>() |
|||
.in(SzCheckingRecord::getId, SzCheckingV2Service.getIntList(ids))); |
|||
} |
|||
return Boolean.FALSE; |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,19 @@ |
|||
package com.kms.yxgh.sz.service; |
|||
|
|||
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectItem; |
|||
import com.kms.yxgh.sz.mapper.SzCheckingV2ProjectItemMapper; |
|||
import com.shuili.common.core.service.BaseService; |
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 项目管理项 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SzCheckingV2ProjectItemV2Service extends BaseService<SzCheckingV2ProjectItemMapper, SzCheckingV2ProjectItem> { |
|||
|
|||
} |
@ -0,0 +1,233 @@ |
|||
package com.kms.yxgh.sz.service; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.kms.yxgh.df.service.DfCheckingV2Service; |
|||
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectItem; |
|||
import com.kms.yxgh.sz.domain.SzCheckingV2ProjectManage; |
|||
import com.kms.yxgh.sz.dto.v2.SzCheckingDetailDto; |
|||
import com.kms.yxgh.sz.dto.v2.SzV2CheckingDto; |
|||
import com.kms.yxgh.sz.dto.v2.SzV2CheckingSearchDto; |
|||
import com.kms.yxgh.sz.mapper.SzCheckingV2Mapper; |
|||
import com.shuili.common.core.domain.SearchParam; |
|||
import com.shuili.common.core.service.BaseService; |
|||
import com.shuili.common.utils.BeanUtils; |
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
/** |
|||
* 水闸项目管理 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SzCheckingV2Service extends BaseService<SzCheckingV2Mapper, SzCheckingV2ProjectManage> { |
|||
|
|||
private final SzCheckingV2ProjectItemV2Service szCheckingV2ProjectItemV2Service; |
|||
|
|||
public IPage<SzV2CheckingDto> list(SearchParam<SzV2CheckingSearchDto> sp) { |
|||
// 分页参数
|
|||
Page<SzCheckingV2ProjectManage> page = new Page<>(sp.getPageNum(), sp.getPageSize()); |
|||
SzV2CheckingSearchDto data = sp.getData(); |
|||
|
|||
// 构建查询条件
|
|||
LambdaQueryWrapper<SzCheckingV2ProjectManage> queryWrapper = new LambdaQueryWrapper<>(); |
|||
if (!ObjectUtils.isEmpty(data)) { |
|||
Optional.ofNullable(data.getCategory()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(category -> queryWrapper.eq(SzCheckingV2ProjectManage::getCategory, category)); |
|||
|
|||
Optional.ofNullable(data.getType()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(type -> queryWrapper.eq(SzCheckingV2ProjectManage::getType, type)); |
|||
|
|||
Optional.ofNullable(data.getName()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(name -> queryWrapper.like(SzCheckingV2ProjectManage::getName, name)); |
|||
} |
|||
|
|||
// 查询分页数据
|
|||
Page<SzCheckingV2ProjectManage> queryPage = page(page, queryWrapper); |
|||
if (queryPage == null) { |
|||
return new Page<>(); |
|||
} |
|||
|
|||
// 转换为 DTO 分页对象
|
|||
Page<SzV2CheckingDto> dtoPage = new Page<>(); |
|||
BeanUtils.copyProperties(queryPage, dtoPage); |
|||
|
|||
// 处理查询结果
|
|||
List<SzV2CheckingDto> vos = queryPage.getRecords().stream() |
|||
.map(record -> { |
|||
SzV2CheckingDto dto = new SzV2CheckingDto(); |
|||
BeanUtils.copyProperties(record, dto); |
|||
return dto; |
|||
}) |
|||
.collect(Collectors.toList()); |
|||
|
|||
// 获取关联的项目项
|
|||
List<String> ids = vos.stream() |
|||
.map(SzV2CheckingDto::getId) |
|||
.collect(Collectors.toList()); |
|||
|
|||
if (CollectionUtils.isEmpty(ids)) { |
|||
return dtoPage; |
|||
} |
|||
|
|||
|
|||
List<SzCheckingV2ProjectItem> items = |
|||
szCheckingV2ProjectItemV2Service |
|||
.list(new LambdaQueryWrapper<SzCheckingV2ProjectItem>() |
|||
.in(SzCheckingV2ProjectItem::getCheckingId,ids)); |
|||
|
|||
|
|||
// 将项目项关联到 DTO
|
|||
vos.forEach(dto -> { |
|||
List<SzCheckingDetailDto.SzCheckingItemDto> itemDtos = items.stream() |
|||
.filter(item -> Objects.equals(item.getCheckingId(), dto.getId())) |
|||
.map(SzCheckingV2Service::convertToItemDto) |
|||
.collect(Collectors.toList()); |
|||
dto.setItems(itemDtos); |
|||
}); |
|||
|
|||
dtoPage.setRecords(vos); |
|||
return dtoPage; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 将 DfCheckingV2ProjectItem 转换为 DfCheckingDetailDto.DfCheckingItemDto |
|||
* |
|||
* @param item 原始对象 |
|||
* @return 转换后的 DTO 对象 |
|||
*/ |
|||
public static SzCheckingDetailDto.SzCheckingItemDto convertToItemDto(SzCheckingV2ProjectItem item) { |
|||
SzCheckingDetailDto.SzCheckingItemDto itemDto = new SzCheckingDetailDto.SzCheckingItemDto(); |
|||
itemDto.setId(item.getId()); |
|||
itemDto.setContent(item.getContent()); |
|||
|
|||
// 处理 parts 字段
|
|||
Optional.ofNullable(item.getParts()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(parts -> itemDto.setParts(Arrays.asList(parts.split(",")))); |
|||
|
|||
return itemDto; |
|||
} |
|||
|
|||
public SzV2CheckingDto getInfo(String id) { |
|||
SzCheckingV2ProjectManage szCheckingV2ProjectManage = getById(id); |
|||
SzV2CheckingDto dto = new SzV2CheckingDto(); |
|||
if (!Objects.isNull(szCheckingV2ProjectManage)) { |
|||
BeanUtils.copyProperties(szCheckingV2ProjectManage, dto); |
|||
List<SzCheckingV2ProjectItem> items = szCheckingV2ProjectItemV2Service |
|||
.list(new LambdaQueryWrapper<SzCheckingV2ProjectItem>() |
|||
.eq(SzCheckingV2ProjectItem::getCheckingId,id)); |
|||
dto.setItems(items.stream() |
|||
.map(SzCheckingV2Service::convertToItemDto) |
|||
.collect(Collectors.toList())); |
|||
} |
|||
return dto; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public SzV2CheckingDto add(SzV2CheckingDto dto) { |
|||
// 将 DTO 转换为实体对象
|
|||
SzCheckingV2ProjectManage szCheckingV2ProjectManage = new SzCheckingV2ProjectManage(); |
|||
BeanUtils.copyProperties(dto, szCheckingV2ProjectManage); |
|||
|
|||
// 保存实体对象
|
|||
if (!save(szCheckingV2ProjectManage)) { |
|||
throw new RuntimeException("保存失败"); |
|||
} |
|||
// 处理关联的 items
|
|||
Optional.ofNullable(dto.getItems()) |
|||
.filter(items -> !items.isEmpty()) |
|||
.ifPresent(items -> { |
|||
List<SzCheckingV2ProjectItem> projectItems = items.parallelStream() // 使用并行流
|
|||
.map(item -> { |
|||
SzCheckingV2ProjectItem projectItem = new SzCheckingV2ProjectItem(); |
|||
projectItem.setCheckingId(szCheckingV2ProjectManage.getId()); |
|||
projectItem.setContent(item.getContent()); |
|||
projectItem.setParts(String.join(",", item.getParts())); |
|||
return projectItem; |
|||
}) |
|||
.collect(Collectors.toList()); |
|||
// 批量保存 items
|
|||
szCheckingV2ProjectItemV2Service.saveBatch(projectItems); |
|||
}); |
|||
return dto; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public SzV2CheckingDto edit(SzV2CheckingDto dfV2Ck) { |
|||
|
|||
|
|||
if (StringUtils.isBlank(dfV2Ck.getId())) { |
|||
return null; |
|||
} |
|||
|
|||
SzCheckingV2ProjectManage szCheckingV2ProjectManage = getById(dfV2Ck.getId()); |
|||
if (szCheckingV2ProjectManage == null) { |
|||
return null; |
|||
} |
|||
|
|||
BeanUtils.copyProperties(dfV2Ck, szCheckingV2ProjectManage); |
|||
|
|||
if (!updateById(szCheckingV2ProjectManage)) { |
|||
throw new RuntimeException("修改失败"); |
|||
} |
|||
|
|||
szCheckingV2ProjectItemV2Service |
|||
.remove(new LambdaQueryWrapper<SzCheckingV2ProjectItem>() |
|||
.eq(SzCheckingV2ProjectItem::getCheckingId, dfV2Ck.getId())); |
|||
|
|||
|
|||
List<SzCheckingV2ProjectItem> items = dfV2Ck.getItems().stream() |
|||
.map(item -> { |
|||
SzCheckingV2ProjectItem projectItem = new SzCheckingV2ProjectItem(); |
|||
projectItem.setId(item.getId()); |
|||
projectItem.setCheckingId(szCheckingV2ProjectManage.getId()); |
|||
projectItem.setContent(item.getContent()); |
|||
projectItem.setParts(String.join(",", item.getParts())); |
|||
return projectItem; |
|||
}) |
|||
.collect(Collectors.toList()); |
|||
|
|||
if (!szCheckingV2ProjectItemV2Service.saveOrUpdateBatch(items)) { |
|||
throw new RuntimeException("项目子项修改失败"); |
|||
} |
|||
|
|||
return dfV2Ck; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public boolean myRemove(String[] ids) { |
|||
if (null != ids && ids.length > 0) { |
|||
szCheckingV2ProjectItemV2Service.remove(new LambdaQueryWrapper<SzCheckingV2ProjectItem>() |
|||
.in(SzCheckingV2ProjectItem::getCheckingId, getIntList(ids))); |
|||
|
|||
return remove(new LambdaQueryWrapper<SzCheckingV2ProjectManage>() |
|||
.in(SzCheckingV2ProjectManage::getId, getIntList(ids))); |
|||
} |
|||
return Boolean.FALSE; |
|||
} |
|||
|
|||
public static List<Integer> getIntList(String[] ids) { |
|||
return DfCheckingV2Service.getIntList(ids); |
|||
} |
|||
|
|||
public static List<String> getStringList(String[] ids) { |
|||
return DfCheckingV2Service.getStringList(ids); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,225 @@ |
|||
package com.kms.yxgh.sz.service; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.kms.yxgh.common.ApprovalStatusEnum; |
|||
import com.kms.yxgh.common.ApprovalTypeEnum; |
|||
import com.kms.yxgh.common.dto.ApprovalDetailDto; |
|||
import com.kms.yxgh.common.dto.ApprovalSearchDto; |
|||
import com.kms.yxgh.common.dto.DocV2Dto; |
|||
import com.kms.yxgh.common.enums.DfYhV2StatusEnum; |
|||
import com.kms.yxgh.common.service.ApprovalService; |
|||
import com.kms.yxgh.common.service.DefaultApprovalBusinessService; |
|||
import com.kms.yxgh.df.domain.DfCheckingRecord; |
|||
import com.kms.yxgh.df.domain.DfYhV2; |
|||
import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto; |
|||
import com.kms.yxgh.df.dto.v2.DfYhApproveDto; |
|||
import com.kms.yxgh.df.service.DfCheckingV2Service; |
|||
import com.kms.yxgh.sz.domain.SzCheckingRecord; |
|||
import com.kms.yxgh.sz.domain.SzYhV2; |
|||
import com.kms.yxgh.sz.dto.v2.SzRecordSearchV2Dto; |
|||
import com.kms.yxgh.sz.dto.v2.SzYhApproveDto; |
|||
import com.kms.yxgh.sz.dto.v2.SzYhDetailV2Dto; |
|||
import com.kms.yxgh.sz.dto.v2.SzYhListV2Dto; |
|||
import com.kms.yxgh.sz.mapper.SzCheckingRecordV2Mapper; |
|||
import com.kms.yxgh.sz.mapper.SzYhV2Mapper; |
|||
import com.shuili.common.core.domain.SearchParam; |
|||
import com.shuili.common.utils.BeanUtils; |
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.Objects; |
|||
import java.util.Optional; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 项目管理记录 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SzYhV2Service extends DefaultApprovalBusinessService<SzYhV2Mapper, SzYhV2, SzRecordSearchV2Dto, SzYhApproveDto> { |
|||
|
|||
private ApprovalService approvalService; |
|||
|
|||
private SzCheckingRecordV2Mapper szCheckingRecordV2Mapper; |
|||
|
|||
public IPage<SzYhListV2Dto> list(SearchParam<SzRecordSearchV2Dto> sp) { |
|||
// 分页参数
|
|||
Page<SzYhV2> page = new Page<>(sp.getPageNum(), sp.getPageSize()); |
|||
SzRecordSearchV2Dto data = sp.getData(); |
|||
|
|||
// 构建查询条件
|
|||
LambdaQueryWrapper<SzYhV2> queryWrapper = new LambdaQueryWrapper<>(); |
|||
if (!ObjectUtils.isEmpty(data)) { |
|||
Optional.ofNullable(data.getCategory()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(category -> queryWrapper.eq(SzYhV2::getCategory, category)); |
|||
|
|||
Optional.ofNullable(data.getType()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(type -> queryWrapper.eq(SzYhV2::getType, type)); |
|||
|
|||
Optional.ofNullable(data.getName()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(name -> queryWrapper.like(SzYhV2::getName, name)); |
|||
|
|||
Optional.ofNullable(data.getDutyHolder()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(dutyHolder -> queryWrapper.like(SzYhV2::getDutyHolderName, dutyHolder)); |
|||
|
|||
Optional.ofNullable(data.getStatus()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(status -> queryWrapper.like(SzYhV2::getStatus, status)); |
|||
|
|||
if (!Objects.isNull(data.getStartDate())) { |
|||
queryWrapper.ge(SzYhV2::getStartDate, data.getStartDate()); |
|||
} |
|||
|
|||
if (!Objects.isNull(data.getEndDate())) { |
|||
queryWrapper.le(SzYhV2::getEndDate, data.getEndDate()); |
|||
} |
|||
|
|||
Optional.ofNullable(data.getProblemLevel()) |
|||
.filter(StringUtils::isNotBlank) |
|||
.ifPresent(problemLevel -> queryWrapper.eq(SzYhV2::getProblemLevel, problemLevel)); |
|||
|
|||
Optional.ofNullable(data.getRecordId()) |
|||
.filter(StringUtils::isBlank) |
|||
.ifPresent(recordId -> queryWrapper.eq(SzYhV2::getRecordId, recordId)); |
|||
|
|||
} |
|||
|
|||
// 查询分页数据
|
|||
Page<SzYhV2> queryPage = page(page, queryWrapper); |
|||
if (queryPage == null) { |
|||
return new Page<>(); |
|||
} |
|||
|
|||
// 转换为 DTO 分页对象
|
|||
Page<SzYhListV2Dto> dtoPage = new Page<>(); |
|||
BeanUtils.copyProperties(queryPage, dtoPage); |
|||
|
|||
// 处理查询结果
|
|||
List<SzYhListV2Dto> vos = queryPage.getRecords().stream() |
|||
.map(record -> { |
|||
SzYhListV2Dto dto = new SzYhListV2Dto(); |
|||
BeanUtils.copyProperties(record, dto); |
|||
dto.setApprovalId(approvalService.getTaskId(dto.getId(), ApprovalTypeEnum.YH_V2_RECORD)); |
|||
return dto; |
|||
}) |
|||
.collect(Collectors.toList()); |
|||
dtoPage.setRecords(vos); |
|||
return dtoPage; |
|||
} |
|||
|
|||
|
|||
public SzYhDetailV2Dto getInfo(String id) { |
|||
SzYhDetailV2Dto dto = new SzYhDetailV2Dto(); |
|||
SzYhV2 dfYhV2 = getById(id); |
|||
if (dfYhV2 != null) { |
|||
BeanUtils.copyProperties(dfYhV2, dto); |
|||
dto.setDoc(JSONObject.parseObject(dfYhV2.getDoc(), DocV2Dto.class)); |
|||
} |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
public Boolean myRemove(String[] ids) { |
|||
if (null != ids && ids.length > 0) { |
|||
return remove(new LambdaQueryWrapper<SzYhV2>() |
|||
.in(SzYhV2::getId, DfCheckingV2Service.getIntList(ids))); |
|||
} |
|||
return Boolean.FALSE; |
|||
} |
|||
|
|||
public SzYhDetailV2Dto edit(SzYhDetailV2Dto szYh, Boolean commit) { |
|||
SzYhDetailV2Dto dto = new SzYhDetailV2Dto(); |
|||
SzYhV2 szYhV2 = new SzYhV2(); |
|||
if (commit) { |
|||
BeanUtils.copyProperties(szYh, szYhV2); |
|||
szYhV2.setDoc(getDocStrJson(szYh.getDoc())); |
|||
szYhV2.setStatus(DfYhV2StatusEnum.YES_UNDER.getValue()); |
|||
saveOrUpdate(szYhV2); |
|||
BeanUtils.copyProperties(szYhV2, dto); |
|||
approvalService.submit(szYhV2.getId(), ApprovalTypeEnum.SZ_V2_YH_RECORD); |
|||
return dto; |
|||
} else { |
|||
BeanUtils.copyProperties(szYh, szYhV2); |
|||
szYhV2.setDoc(getDocStrJson(szYh.getDoc())); |
|||
szYhV2.setStatus(DfYhV2StatusEnum.UNDER_MAINTENANCE.getValue()); |
|||
saveOrUpdate(szYhV2); |
|||
BeanUtils.copyProperties(szYhV2, dto); |
|||
return dto; |
|||
} |
|||
} |
|||
|
|||
private static String getDocStrJson(DocV2Dto dto) { |
|||
if (dto == null) { |
|||
return null; |
|||
} |
|||
return JSONObject.toJSONString(dto); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public IPage<ApprovalDetailDto<SzYhApproveDto>> approvalSearch(SearchParam<ApprovalSearchDto<SzRecordSearchV2Dto>> sp) { |
|||
if (sp.getData() == null) { |
|||
return new Page<>(); |
|||
} |
|||
return this.getBaseMapper().approvalSearchPage(new Page<>(sp.getPageNum(), sp.getPageSize()), sp.getData()); |
|||
} |
|||
|
|||
@Override |
|||
public void updateApprovalStatus(String formId, ApprovalStatusEnum status) { |
|||
String formStatus; |
|||
switch (status){ |
|||
case PASS: |
|||
formStatus = DfYhV2StatusEnum.ACCEPTED.getValue(); |
|||
// 验收同步修改掉记录列表的状态
|
|||
synRecordStatus(formId,formStatus); |
|||
break; |
|||
case REJECT: |
|||
formStatus = DfYhV2StatusEnum.UNDER_MAINTENANCE.getValue(); |
|||
break; |
|||
default: |
|||
formStatus = DfYhV2StatusEnum.YES_UNDER.getValue(); |
|||
} |
|||
Wrapper<SzYhV2> wp = Wrappers.<SzYhV2>lambdaUpdate() |
|||
.eq(SzYhV2::getId, formId) |
|||
.set(SzYhV2::getStatus, formStatus); |
|||
this.update(null, wp); |
|||
} |
|||
|
|||
|
|||
private void synRecordStatus(String formId, String status){ |
|||
SzYhV2 byId = getById(formId); |
|||
List<SzYhV2> list = list(new LambdaQueryWrapper<SzYhV2>().eq(SzYhV2::getRecordId, byId.getRecordId())); |
|||
if (CollectionUtils.isNotEmpty(list) && !list.isEmpty()) { |
|||
long count = list.stream().filter(e -> Objects.equals(DfYhV2StatusEnum.ACCEPTED.getValue(), e.getStatus())).count(); |
|||
if (count+1==list.size()) { |
|||
Wrapper<SzCheckingRecord> wp = Wrappers.<SzCheckingRecord>lambdaUpdate() |
|||
.eq(SzCheckingRecord::getId, byId.getRecordId()) |
|||
.set(SzCheckingRecord::getStatus, status); |
|||
szCheckingRecordV2Mapper.update(null,wp); |
|||
} |
|||
} |
|||
} |
|||
@Override |
|||
public String formStatus(String formId) { |
|||
return ApprovalStatusEnum.SUBMITTING.getValue(); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,71 @@ |
|||
<?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.kms.yxgh.sz.mapper.SzYhV2Mapper"> |
|||
|
|||
<resultMap id="approvalMap" type="com.kms.yxgh.common.dto.ApprovalDetailDto"> |
|||
<id property="id" column="id"/> |
|||
<result property="formId" column="formId"/> |
|||
<result property="submitTime" column="submit_time"/> |
|||
<result property="approvalTime" column="approval_time"/> |
|||
<result property="status" column="status"/> |
|||
<result property="comment" column="comment"/> |
|||
<result property="operator" column="operator" typeHandler="com.kms.yxgh.common.mapper.handler.OperatorHandler"/> |
|||
<result property="doc" column="ts_doc" typeHandler="com.kms.yxgh.common.mapper.handler.DocHandler"/> |
|||
<association property="detail" javaType="com.kms.yxgh.sz.dto.v2.SzYhApproveDto"> |
|||
<id property="id" column="jl_id"/> |
|||
<result property="name" column="name"/> |
|||
<result property="status" column="yh_status"/> |
|||
<result property="wagaCode" column="waga_code"/> |
|||
<result property="wagaName" column="waga_name"/> |
|||
<result property="type" column="type"/> |
|||
<result property="category" column="category"/> |
|||
<result property="problemLevel" column="problem_level"/> |
|||
<result property="dutyHolderId" column="duty_holder_id"/> |
|||
<result property="dutyHolderName" column="duty_holder_name"/> |
|||
<result property="problemId" column="problem_id"/> |
|||
<result property="recordId" column="record_id"/> |
|||
</association> |
|||
</resultMap> |
|||
|
|||
<select id="approvalSearchPage" resultMap="approvalMap"> |
|||
SELECT ts.id id, ts.form_id formId, ts.create_time submit_time, ts.approval_time approval_time, ts.status status, |
|||
ts.operator operator, ts.comment comment, ts.doc ts_doc, |
|||
jl.id , jl.name ,jl.waga_code , jl.waga_name , jl.type type, jl.category , |
|||
jl.problem_level , jl.duty_holder_id , jl.duty_holder_name, jl.problem_id , jl.record_id, jl.status yh_status |
|||
FROM bs_sgc_sp_task ts |
|||
LEFT JOIN bs_sgc_Sz_xcyj jl ON jl.id = ts.form_id |
|||
WHERE |
|||
ts.business_type = #{dto.businessType} |
|||
and ts.status in ('1','2') |
|||
<if test="dto.status != null and dto.status != ''"> |
|||
AND ts.status = #{dto.status} |
|||
</if> |
|||
<if test="dto.condition!= null and dto.condition.name != null"> |
|||
AND jl.name LIKE CONCAT('%',#{dto.condition.name},'%') |
|||
</if> |
|||
<if test="dto.condition!= null and dto.condition.type != null and dto.condition.type != ''"> |
|||
AND jl.type = #{dto.condition.type} |
|||
</if> |
|||
<if test="dto.condition!= null and dto.condition.category != null and dto.condition.category != ''"> |
|||
AND jl.category = #{dto.condition.category} |
|||
</if> |
|||
<if test="dto.condition!= null and dto.condition.problemLevel != null and dto.condition.problemLevel != ''"> |
|||
AND jl.problem_level = #{dto.condition.problemLevel} |
|||
</if> |
|||
<if test="dto.condition!= null and dto.condition.status != null and dto.condition.status != ''"> |
|||
AND jl.status = #{dto.condition.status} |
|||
</if> |
|||
<if test="dto.condition!= null and dto.condition.startDate != null and dto.condition.startDate != ''"> |
|||
AND jl.start_date >= #{dto.condition.startDate} |
|||
</if> |
|||
<if test="dto.condition!= null and dto.condition.endDate != null and dto.condition.endDate != ''"> |
|||
AND jl.end_date <= #{dto.condition.endDate} |
|||
</if> |
|||
<if test="dto.condition!= null and dto.condition.dutyHolder != null and dto.condition.dutyHolder != ''"> |
|||
AND jl.duty_holder_id = #{dto.condition.dutyHolder} |
|||
</if> |
|||
ORDER BY jl.update_time DESC |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue