19 changed files with 718 additions and 27 deletions
@ -0,0 +1,125 @@ |
|||||
|
package com.qs.serve.modules.tbs.common.dto; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.SqlCondition; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/11 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TbsBudgetChangeVo { |
||||
|
|
||||
|
/** 类型:apply,change */ |
||||
|
private String type; |
||||
|
|
||||
|
/** 预算id */ |
||||
|
private Long budgetId; |
||||
|
|
||||
|
/** 预算更变id */ |
||||
|
private Long budgetChangeId; |
||||
|
|
||||
|
/** 更变记录编码 */ |
||||
|
@Length(max = 30,message = "更变记录编码长度不能超过30字") |
||||
|
private String changeCode; |
||||
|
|
||||
|
/** 名称 */ |
||||
|
@NotBlank(message = "名称不能为空") |
||||
|
@Length(max = 30,message = "名称长度不能超过30字") |
||||
|
private String budgetTitle; |
||||
|
|
||||
|
/** 名称 */ |
||||
|
private String newBudgetTitle; |
||||
|
|
||||
|
/** 编码 */ |
||||
|
@Length(max = 30,message = "编码长度不能超过30字") |
||||
|
private String budgetNumber; |
||||
|
|
||||
|
/** 审批状态 */ |
||||
|
@NotNull(message = "审批状态不能为空") |
||||
|
private Integer budgetCheckState; |
||||
|
|
||||
|
/** 科目id */ |
||||
|
@NotNull(message = "科目id不能为空") |
||||
|
private Long subjectId; |
||||
|
|
||||
|
/** 科目编码 */ |
||||
|
@Length(max = 30,message = "科目编码长度不能超过30字") |
||||
|
private String subjectCode; |
||||
|
|
||||
|
/** 科目名称 */ |
||||
|
@Length(max = 30,message = "科目名称长度不能超过30字") |
||||
|
private String subjectName; |
||||
|
|
||||
|
/** 成本中心类型 */ |
||||
|
@NotBlank(message = "成本中心类型不能为空") |
||||
|
@Length(max = 20,message = "成本中心类型长度不能超过20字") |
||||
|
private String centerType; |
||||
|
|
||||
|
/** 成本中心id */ |
||||
|
@NotBlank(message = "成本中心id不能为空") |
||||
|
@Length(max = 32,message = "成本中心id长度不能超过32字") |
||||
|
private String centerId; |
||||
|
|
||||
|
/** 成本中心编码 */ |
||||
|
@NotBlank(message = "成本中心编码不能为空") |
||||
|
@Length(max = 30,message = "成本中心编码长度不能超过30字") |
||||
|
private String centerCode; |
||||
|
|
||||
|
/** 成本中心名称 */ |
||||
|
@NotBlank(message = "成本中心名称不能为空") |
||||
|
@Length(max = 30,message = "成本中心名称长度不能超过30字") |
||||
|
private String centerName; |
||||
|
|
||||
|
/** 考核期id */ |
||||
|
@NotNull(message = "考核期id不能为空") |
||||
|
private Long scheduleId; |
||||
|
|
||||
|
/** 考核期编码 */ |
||||
|
@NotBlank(message = "考核期编码不能为空") |
||||
|
@Length(max = 30,message = "考核期编码长度不能超过30字") |
||||
|
private String scheduleCode; |
||||
|
|
||||
|
/** 考核期名称 */ |
||||
|
@NotBlank(message = "考核期名称不能为空") |
||||
|
@Length(max = 30,message = "考核期名称长度不能超过30字") |
||||
|
private String scheduleName; |
||||
|
|
||||
|
/** 致远表单id */ |
||||
|
private String syFormId; |
||||
|
|
||||
|
/** 提交审批时间 */ |
||||
|
@Length(max = 0,message = "提交审批时间长度不能超过0字") |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime submitTime; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userId; |
||||
|
|
||||
|
/** 用户编码 */ |
||||
|
@Length(max = 32,message = "长度不能超过32字") |
||||
|
private String userCode; |
||||
|
|
||||
|
/** 用户名称 */ |
||||
|
@Length(max = 32,message = "长度不能超过32字") |
||||
|
@TableField(condition = SqlCondition.LIKE) |
||||
|
private String userName; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.qs.serve.modules.tbs.entity.so; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/11 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TbsBudgetChangeSo { |
||||
|
|
||||
|
/** 审批状态:0=未发布;1=审批中;2=完成;3-被驳回;4-中止 */ |
||||
|
private Integer budgetCheckState; |
||||
|
|
||||
|
/** 编码 */ |
||||
|
private String code; |
||||
|
|
||||
|
private String title; |
||||
|
|
||||
|
/** 预算ID */ |
||||
|
private Long budgetId; |
||||
|
|
||||
|
private String budgetNumber; |
||||
|
|
||||
|
private String userId; |
||||
|
|
||||
|
private String userName; |
||||
|
|
||||
|
private String userCode; |
||||
|
|
||||
|
private String subjectName; |
||||
|
|
||||
|
private String subjectCode; |
||||
|
|
||||
|
private String centerCode; |
||||
|
|
||||
|
private String centerName; |
||||
|
|
||||
|
private Integer startRow; |
||||
|
|
||||
|
private Integer pageSize; |
||||
|
|
||||
|
} |
@ -0,0 +1,156 @@ |
|||||
|
<?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.qs.serve.modules.tbs.mapper.TbsBudgetChangeMapper"> |
||||
|
|
||||
|
<resultMap id="tbsBudgetChangeMap" type="com.qs.serve.modules.tbs.common.dto.TbsBudgetChangeVo" > |
||||
|
<result property="budgetId" column="budget_id"/> |
||||
|
<result property="budgetChangeId" column="budget_change_id"/> |
||||
|
<result property="changeCode" column="change_code"/> |
||||
|
<result property="budgetTitle" column="budget_title"/> |
||||
|
<result property="newBudgetTitle" column="new_budget_title"/> |
||||
|
<result property="budgetNumber" column="budget_number"/> |
||||
|
<result property="budgetCheckState" column="budget_check_state"/> |
||||
|
<result property="subjectId" column="subject_id"/> |
||||
|
<result property="subjectCode" column="subject_code"/> |
||||
|
<result property="subjectName" column="subject_name"/> |
||||
|
<result property="centerType" column="center_type"/> |
||||
|
<result property="centerId" column="center_id"/> |
||||
|
<result property="centerCode" column="center_code"/> |
||||
|
<result property="centerName" column="center_name"/> |
||||
|
<result property="scheduleId" column="schedule_id"/> |
||||
|
<result property="scheduleCode" column="schedule_code"/> |
||||
|
<result property="scheduleName" column="schedule_name"/> |
||||
|
<result property="submitTime" column="submit_time"/> |
||||
|
<result property="syFormId" column="sy_form_id"/> |
||||
|
<result property="remark" column="remark"/> |
||||
|
<result property="userId" column="user_id"/> |
||||
|
<result property="userCode" column="user_code"/> |
||||
|
<result property="userName" column="user_name"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="selectChangeVoList" resultType="com.qs.serve.modules.tbs.common.dto.TbsBudgetChangeVo"> |
||||
|
select |
||||
|
'apply' as type, |
||||
|
null as `budget_change_id`, |
||||
|
tbs_budget.`id` as budget_id, |
||||
|
null as `change_code`, |
||||
|
tbs_budget.`budget_code` as budget_title, |
||||
|
null as `new_budget_title`, |
||||
|
tbs_budget.`budget_number`, |
||||
|
tbs_budget.`budget_state`, |
||||
|
tbs_budget.`budget_check_state`, |
||||
|
tbs_budget.`subject_id`, |
||||
|
tbs_budget.`subject_code`, |
||||
|
tbs_budget.`subject_name`, |
||||
|
tbs_budget.`center_type`, |
||||
|
tbs_budget.`center_id`, |
||||
|
tbs_budget.`center_code`, |
||||
|
tbs_budget.`center_name`, |
||||
|
tbs_budget.`schedule_id`, |
||||
|
tbs_budget.`schedule_code`, |
||||
|
tbs_budget.`schedule_name`, |
||||
|
tbs_budget.`submit_time`, |
||||
|
tbs_budget.`user_id`, |
||||
|
tbs_budget.`user_code`, |
||||
|
tbs_budget.`user_name`, |
||||
|
tbs_budget.`remark` |
||||
|
from tbs_budget |
||||
|
where tbs_budget.del_flag = 0 and `tbs_budget`.`budget_check_state` != 0 |
||||
|
<if test="query.title != null and query.title != ''"> and `tbs_budget`.`budget_code` like concat('%',#{query.title},'%') </if> |
||||
|
<if test="query.code != null and query.code != ''"> and `tbs_budget`.`budget_number` like concat('%',#{query.code},'%')</if> |
||||
|
<if test="query.budgetCheckState != null"> and `tbs_budget`.`budget_check_state` = #{query.budgetCheckState}</if> |
||||
|
<if test="query.subjectCode != null and query.subjectCode != ''"> and `tbs_budget`.`subject_code` like concat('%',#{query.subjectCode},'%') </if> |
||||
|
<if test="query.subjectName != null and query.subjectName != ''"> and `tbs_budget`.`subject_name` like concat('%',#{query.subjectName},'%') </if> |
||||
|
<if test="query.centerCode != null and query.centerCode != ''"> and `tbs_budget`.`center_code` like concat('%',#{query.centerCode},'%') </if> |
||||
|
<if test="query.centerName != null and query.centerName != ''"> and `tbs_budget`.`center_name` like concat('%',#{query.centerName},'%') </if> |
||||
|
<if test="query.userId != null and query.userId != ''"> and `tbs_budget`.`user_id` = #{query.userId}</if> |
||||
|
<if test="query.userCode != null and query.userCode != ''"> and `tbs_budget`.`user_code` like concat('%',#{query.userCode},'%')</if> |
||||
|
<if test="query.userName != null and query.userName != ''"> and `tbs_budget`.`user_name` like concat('%',#{query.userName},'%')</if> |
||||
|
union |
||||
|
select |
||||
|
'change' as type, |
||||
|
tbs_budget_change.`id` as budget_change_id, |
||||
|
tbs_budget_change.`budget_id`, |
||||
|
tbs_budget_change.`change_code`, |
||||
|
tbs_budget_change.`budget_title`, |
||||
|
tbs_budget_change.`new_budget_title`, |
||||
|
tbs_budget_change.`budget_number`, |
||||
|
null as budget_state, |
||||
|
tbs_budget_change.`budget_check_state`, |
||||
|
tbs_budget_change.`subject_id`, |
||||
|
tbs_budget_change.`subject_code`, |
||||
|
tbs_budget_change.`subject_name`, |
||||
|
tbs_budget_change.`center_type`, |
||||
|
tbs_budget_change.`center_id`, |
||||
|
tbs_budget_change.`center_code`, |
||||
|
tbs_budget_change.`center_name`, |
||||
|
tbs_budget_change.`schedule_id`, |
||||
|
tbs_budget_change.`schedule_code`, |
||||
|
tbs_budget_change.`schedule_name`, |
||||
|
tbs_budget_change.`submit_time`, |
||||
|
tbs_budget_change.`remark`, |
||||
|
tbs_budget_change.`user_id`, |
||||
|
tbs_budget_change.`user_code`, |
||||
|
tbs_budget_change.`user_name` |
||||
|
from tbs_budget_change |
||||
|
where tbs_budget_change.del_flag = 0 |
||||
|
<if test="query.code != null and query.code != ''"> |
||||
|
and (`tbs_budget_change`.`change_code` like concat('%',#{query.code},'%') |
||||
|
or `tbs_budget_change`.`budget_number` like concat('%',#{query.code},'%') ) |
||||
|
</if> |
||||
|
<if test="query.title != null and query.title != ''"> and `tbs_budget_change`.`budget_title` like concat('%',#{query.title},'%') </if> |
||||
|
<if test="query.budgetCheckState != null"> and `tbs_budget_change`.`budget_check_state` = #{query.budgetCheckState}</if> |
||||
|
<if test="query.subjectCode != null and query.subjectCode != ''"> and `tbs_budget_change`.`subject_code` like concat('%',#{query.subjectCode},'%') </if> |
||||
|
<if test="query.subjectName != null and query.subjectName != ''"> and `tbs_budget_change`.`subject_name` like concat('%',#{query.subjectName},'%') </if> |
||||
|
<if test="query.centerCode != null and query.centerCode != ''"> and `tbs_budget_change`.`center_code` like concat('%',#{query.centerCode},'%') </if> |
||||
|
<if test="query.centerName != null and query.centerName != ''"> and `tbs_budget_change`.`center_name` like concat('%',#{query.centerName},'%') </if> |
||||
|
<if test="query.userId != null and query.userId != ''"> and `tbs_budget_change`.`user_id` = #{query.userId}</if> |
||||
|
<if test="query.userCode != null and query.userCode != ''"> and `tbs_budget_change`.`user_code` like concat('%',#{query.userCode},'%')</if> |
||||
|
<if test="query.userName != null and query.userName != ''"> and `tbs_budget_change`.`user_name` like concat('%',#{query.userName},'%')</if> |
||||
|
limit #{query.startRow},#{query.pageSize} |
||||
|
</select> |
||||
|
|
||||
|
<select id="countChangeVo" resultType="java.lang.Long"> |
||||
|
select count(0) from ( |
||||
|
select |
||||
|
null as `budget_change_id`, |
||||
|
tbs_budget.`id` as budget_id |
||||
|
from tbs_budget |
||||
|
where tbs_budget.del_flag = 0 and `tbs_budget`.`budget_check_state` != 0 |
||||
|
<if test="query.budgetId != null"> and `tbs_budget`.`id` = #{query.budgetId}</if> |
||||
|
<if test="query.title != null and query.title != ''"> and `tbs_budget`.`budget_code` like concat('%',#{query.title},'%') </if> |
||||
|
<if test="query.code != null and query.code != ''"> and `tbs_budget`.`budget_number` like concat('%',#{query.code},'%')</if> |
||||
|
<if test="query.budgetCheckState != null"> and `tbs_budget`.`budget_check_state` = #{query.budgetCheckState}</if> |
||||
|
<if test="query.subjectCode != null and query.subjectCode != ''"> and `tbs_budget`.`subject_code` like concat('%',#{query.subjectCode},'%') </if> |
||||
|
<if test="query.subjectName != null and query.subjectName != ''"> and `tbs_budget`.`subject_name` like concat('%',#{query.subjectName},'%') </if> |
||||
|
<if test="query.centerCode != null and query.centerCode != ''"> and `tbs_budget`.`center_code` like concat('%',#{query.centerCode},'%') </if> |
||||
|
<if test="query.centerName != null and query.centerName != ''"> and `tbs_budget`.`center_name` like concat('%',#{query.centerName},'%') </if> |
||||
|
<if test="query.userId != null and query.userId != ''"> and `tbs_budget`.`user_id` = #{query.userId}</if> |
||||
|
<if test="query.userCode != null and query.userCode != ''"> and `tbs_budget`.`user_code` like concat('%',#{query.userCode},'%')</if> |
||||
|
<if test="query.userName != null and query.userName != ''"> and `tbs_budget`.`user_name` like concat('%',#{query.userName},'%')</if> |
||||
|
union |
||||
|
select |
||||
|
tbs_budget_change.`id` as budget_change_id, |
||||
|
tbs_budget_change.`budget_id` |
||||
|
from tbs_budget_change |
||||
|
where tbs_budget_change.del_flag = 0 |
||||
|
<if test="query.code != null and query.code != ''"> |
||||
|
and (`tbs_budget_change`.`change_code` like concat('%',#{query.code},'%') |
||||
|
or `tbs_budget_change`.`budget_number` like concat('%',#{query.code},'%') ) |
||||
|
</if> |
||||
|
<if test="query.budgetId != null"> and `tbs_budget_change`.`budget_id` = #{query.budgetId}</if> |
||||
|
<if test="query.title != null and query.title != ''"> and `tbs_budget_change`.`budget_title` like concat('%',#{query.title},'%') </if> |
||||
|
<if test="query.budgetCheckState != null"> and `tbs_budget_change`.`budget_check_state` = #{query.budgetCheckState}</if> |
||||
|
<if test="query.subjectCode != null and query.subjectCode != ''"> and `tbs_budget_change`.`subject_code` like concat('%',#{query.subjectCode},'%') </if> |
||||
|
<if test="query.subjectName != null and query.subjectName != ''"> and `tbs_budget_change`.`subject_name` like concat('%',#{query.subjectName},'%') </if> |
||||
|
<if test="query.centerCode != null and query.centerCode != ''"> and `tbs_budget_change`.`center_code` like concat('%',#{query.centerCode},'%') </if> |
||||
|
<if test="query.centerName != null and query.centerName != ''"> and `tbs_budget_change`.`center_name` like concat('%',#{query.centerName},'%') </if> |
||||
|
<if test="query.userId != null and query.userId != ''"> and `tbs_budget_change`.`user_id` = #{query.userId}</if> |
||||
|
<if test="query.userCode != null and query.userCode != ''"> and `tbs_budget_change`.`user_code` like concat('%',#{query.userCode},'%')</if> |
||||
|
<if test="query.userName != null and query.userName != ''"> and `tbs_budget_change`.`user_name` like concat('%',#{query.userName},'%')</if> |
||||
|
) tmp_tbs_budget |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
|
|
Loading…
Reference in new issue