Commit 4d8412dd by Administrator

Merge branch 'tzq' into 'develop'

Tzq

See merge request 8timerv2/8timerapiv200!39
parents 2a5b8754 c5dd34a9
......@@ -276,13 +276,13 @@
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok-maven-plugin -->
......
......@@ -7,6 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
......@@ -22,7 +23,7 @@ import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import cn.hutool.core.net.NetUtil;
@MapperScan("cn.timer.api.dao") // 扫描的mapper
//@ComponentScan(basePackages = {"cn.timer.api.controller"})
@ComponentScan(basePackages = {"cn.timer.api"})
@SpringBootApplication
@EnableScheduling
@EnableTransactionManagement
......
......@@ -2,12 +2,13 @@ package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -61,9 +62,11 @@ public class SpmkApprovalTemplate extends Model<SpmkApprovalTemplate> {
@ApiModelProperty(value = "审批意见 是否必填 意见 0是 1否", example = "101")
private Integer isOpinion;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间 ", example = "更新时间")
private Date updateTime;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
......
......@@ -2,12 +2,13 @@ package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -46,6 +47,7 @@ public class SpmkApprovalTemplateG extends Model<SpmkApprovalTemplateG> {
@ApiModelProperty(value = "排序 排序", example = "101")
private Integer ranks;
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value = "编辑时间 ", example = "编辑时间")
private Date updateTime;
......
package cn.timer.api.bean.spmk;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
......@@ -56,4 +55,7 @@ public class SpmkApproveDetail extends Model<SpmkApproveDetail> {
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private byte[] router;
@ApiModelProperty(value = "通过节点 ", example = "通过节点")
private byte[] flowChildren;
}
\ No newline at end of file
......@@ -2,12 +2,13 @@ package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -52,6 +53,7 @@ public class SpmkApproveExecuteRecord extends Model<SpmkApproveExecuteRecord> {
@ApiModelProperty(value = "状态 0未执行 1审批中 2同意 3拒绝", example = "101")
private Integer sts;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
......
......@@ -2,12 +2,13 @@ package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -56,11 +57,13 @@ public class SpmkApproveSummary extends Model<SpmkApproveSummary> {
private String initiator;
@ApiModelProperty(value = "发起时间 ", example = "发起时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "审批名称 ", example = "审批名称")
private String approveName;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "状态 0审批中 1审批撤销 2审批拒绝 3审批通过/审批完成", example = "101")
private Integer sts;
......@@ -70,6 +73,7 @@ public class SpmkApproveSummary extends Model<SpmkApproveSummary> {
@ApiModelProperty(value = "历史审批人 ", example = "历史审批人")
private String historyApprover;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "最近处理时间 ", example = "最近处理时间")
private Date updateTime;
......
......@@ -2,12 +2,13 @@ package cn.timer.api.bean.spmk;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -64,9 +65,11 @@ public class SpmkCustomApproval extends Model<SpmkCustomApproval> {
@ApiModelProperty(value = "审批意见 是否必填 意见 0是 1否", example = "101")
private Integer isOpinion;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间 ", example = "更新时间")
private Date updateTime;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
......
......@@ -7,7 +7,9 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -59,6 +61,7 @@ public class SpmkExecutor extends Model<SpmkExecutor> {
@ApiModelProperty(value = "状态 0未执行 1执行中 2同意 3拒接", example = "101")
private Integer sts;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime;
......
package cn.timer.api.bean.spmk;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.baomidou.mybatisplus.extension.activerecord.Model;
......
package cn.timer.api.config.autofill;
import java.util.Date;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
@Slf4j
......@@ -15,16 +16,17 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
log.info("start insert fill ....");
this.setInsertFieldValByName("createTime", DateUtil.date(), metaObject);//3.0.7版本后
this.setInsertFieldValByName("regTime", DateUtil.date(), metaObject);//3.0.7版本后
this.setInsertFieldValByName("addtime", DateUtil.date(), metaObject);//薪资档案-定薪
Date date = new Date();
this.strictInsertFill(metaObject, "createTime", Date.class, date); // 起始版本 3.3.0(推荐使用)
this.strictInsertFill(metaObject, "sts", Integer.class, 0); // 起始版本 3.3.0(推荐使用)
}
@Override
public void updateFill(MetaObject metaObject) {
log.info("start update fill ....");
this.setUpdateFieldValByName("createTime", DateUtil.date(), metaObject);//3.0.7版本后
this.setUpdateFieldValByName("updateTime", DateUtil.date(), metaObject);//3.0.7版本后
Date date = new Date();
this.strictUpdateFill(metaObject, "updateTime", Date.class, date); // 起始版本 3.3.0(推荐使用)
}
}
......@@ -17,7 +17,7 @@ import cn.timer.api.dto.spmk.SpmkApprovalTemplateGDto;
@Repository
public interface SpmkApprovalTemplateGMapper extends BaseMapper<SpmkApprovalTemplateG> {
SpmkApprovalTemplateGDto selectListAtInAtg();
List<SpmkApprovalTemplateGDto> selectListAtInAtg();
boolean updateListRandsById(List<SpmkApprovalTemplateG> list);
......
package cn.timer.api.dao.spmk;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.dto.spmk.SummaryQueryDto;
/**
* 审批汇总
......@@ -14,4 +19,6 @@ import cn.timer.api.bean.spmk.SpmkApproveSummary;
@Repository
public interface SpmkApproveSummaryMapper extends BaseMapper<SpmkApproveSummary> {
List<SpmkApproveSummary> selectPageByQuery(IPage<SpmkApproveSummary> page,@Param("param") SummaryQueryDto summaryQueryDto);
}
package cn.timer.api.dto.spmk;
import java.util.List;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -11,7 +11,12 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Condition {
public class Condition implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String key;
......
package cn.timer.api.dto.spmk;
import java.io.Serializable;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FlowChildren implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 节点类型 1.creator-发起 2.audit-审批 3.copy-抄送 4.rules-规则
*/
private String className;
/**
* 执行
*/
private String execute;
/**
* 通过
*/
private Boolean flow;
/**
* 关系
*/
private List<Relation> relation;
}
package cn.timer.api.dto.spmk;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FromData implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String value;
private String id;
}
package cn.timer.api.dto.spmk;
import java.io.Serializable;
import java.util.List;
import lombok.AllArgsConstructor;
......@@ -11,9 +12,13 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Relation {
public class Relation implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 类型
*/
private String type;
......
package cn.timer.api.dto.spmk;
import java.io.Serializable;
import java.util.List;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONSupport;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -12,7 +14,12 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Router extends JSONSupport {
public class Router extends JSONSupport implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 节点类型
......
package cn.timer.api.dto.spmk;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
import cn.timer.api.bean.spmk.SpmkApprovalTemplateG;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SpmkApprovalTemplateGDto extends SpmkApprovalTemplateG{
public class SpmkApprovalTemplateGDto implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private List<SpmkApprovalTemplate> spmkApprovalTemplates;
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "组名 ", example = "组名")
private String name;
@ApiModelProperty(value = "排序 排序", example = "101")
private Integer ranks;
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value = "编辑时间 ", example = "编辑时间")
private Date updateTime;
private List<SpmkApprovalTemplate> spmkApprovalTemplates;
}
package cn.timer.api.dto.spmk;
import javax.persistence.Entity;
import java.util.List;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.spmk.SpmkApproveDetail;
import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
......@@ -38,5 +37,10 @@ public class SpmkApproveDetailDto {
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private Router router;
@ApiModelProperty(value = "通过节点", example = "通过节点")
private List<FlowChildren> listFlowChildren;
@ApiModelProperty(value = "审批执行记录 ", example = "审批执行记录")
private SpmkApproveExecuteRecord spmkApproveExecuteRecord;
}
package cn.timer.api.dto.spmk;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......@@ -13,8 +20,29 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class SpmkApproveSummaryDto{
private SpmkApproveSummary spmkApproveSummary;
/*
* 审批汇总
*/
@ApiModelProperty(value = "标题 ", example = "标题")
private String title;
@ApiModelProperty(value = "审批名称 ", example = "审批名称")
private String approveName;
@ApiModelProperty(value = "发起人名称 ", example = "发起人名称")
private String initiator;
@ApiModelProperty(value = "申请数据 ", example = "申请数据")
private JSONObject requestData;
@ApiModelProperty(value = "审批表单 ", example = "审批表单")
private JSONObject froms;
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private Router router;
private SpmkApproveDetailDto spmkApproveDetailDto;
}
package cn.timer.api.dto.spmk;
import cn.hutool.json.JSONObject;
import cn.timer.api.utils.Page;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SummaryQueryDto extends Page{
private Integer orgCode;
private String query;
private Integer deptId;
private Integer sts;
private String startTime;
private String endTime;
private String[] empNums;
}
package cn.timer.api.dto.spmk;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......@@ -9,7 +11,12 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class User{
public class User implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String name;
......
......@@ -5,7 +5,6 @@
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkApprovalG" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="name" property="name" />
<result column="ranks" property="ranks" />
......@@ -14,13 +13,12 @@
<resultMap id="BaseResultMapDto" type="cn.timer.api.dto.spmk.SpmkApprovalGDto" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="name" property="name" />
<result column="ranks" property="ranks" />
<result column="is_editable" property="isEditable" />
<collection column="SpmkCustomApproval_id" property="spmkCustomApprovals" ofType="cn.timer.api.bean.spmk.SpmkCustomApproval"
resultMap="cn.timer.api.bean.spmk.SpmkCustomApproval.BaseResultMap" columnPrefix="SpmkCustomApproval_">
resultMap="cn.timer.api.dao.spmk.SpmkCustomApprovalMapper.BaseResultMap" columnPrefix="SpmkCustomApproval_">
</collection>
</resultMap>
......@@ -42,35 +40,44 @@
is_editable SpmkApprovalG_is_editable
</sql>
<sql id="Base_Column_List_Alias_a">
a.id,
a.org_code,
a.name,
a.ranks,
a.is_editable
</sql>
<sql id="Base_Column_List_Alias_ca">
id SpmkCustomApproval_id,
org_code SpmkCustomApproval_org_code,
approval_g_id SpmkCustomApproval_approval_g_id,
icon_url SpmkCustomApproval_icon_url,
name SpmkCustomApproval_name,
description SpmkCustomApproval_description,
is_open SpmkCustomApproval_is_open,
ranks SpmkCustomApproval_ranks,
is_opinion SpmkCustomApproval_is_opinion,
update_time SpmkCustomApproval_update_time,
create_time SpmkCustomApproval_create_time,
asso_type SpmkCustomApproval_asso_type,
froms SpmkCustomApproval_froms,
router SpmkCustomApproval_router
b.id SpmkCustomApproval_id,
b.org_code SpmkCustomApproval_org_code,
b.approval_g_id SpmkCustomApproval_approval_g_id,
b.icon_url SpmkCustomApproval_icon_url,
b.name SpmkCustomApproval_name,
b.description SpmkCustomApproval_description,
b.is_open SpmkCustomApproval_is_open,
b.ranks SpmkCustomApproval_ranks,
b.is_opinion SpmkCustomApproval_is_opinion,
b.update_time SpmkCustomApproval_update_time,
b.create_time SpmkCustomApproval_create_time,
b.asso_type SpmkCustomApproval_asso_type,
b.froms SpmkCustomApproval_froms,
b.router SpmkCustomApproval_router
</sql>
<select id="selectListAgInCa" resultMap="BaseResultMapDto">
SELECT
<include refid="Base_Column_List_Alias" />,
<include refid="Base_Column_List_Alias_a" />,
<include refid="Base_Column_List_Alias_ca" />
FROM spmk_approval_g a
LEFT JOIN spmk_custom_approval b IN a.id = b.approval_g_id
LEFT JOIN spmk_custom_approval b ON a.id = b.approval_g_id
WHERE b.org_code = #{org_code} AND b.id in
(
SELECT custom_approval_id FROM spmk_initiator_config WHERE emp_num = #{emp_num} GROUP BY custom_approval_id
)
ORDER BY a.ranks, b.ranks
</select>
<update id="updateListRandsById" parameterType="list">
......
......@@ -5,7 +5,6 @@
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkApprovalTemplateG" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="name" property="name" />
<result column="ranks" property="ranks" />
<result column="update_time" property="updateTime" />
......@@ -13,12 +12,11 @@
<resultMap id="BaseResultMapDto" type="cn.timer.api.dto.spmk.SpmkApprovalTemplateGDto" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="name" property="name" />
<result column="ranks" property="ranks" />
<result column="update_time" property="updateTime" />
<collection column="SpmkApprovalTemplate_id" property="spmkApprovalTemplates" ofType="cn.timer.api.bean.spmk.SpmkApprovalTemplate"
resultMap="cn.timer.api.bean.spmk.SpmkApprovalTemplate.BaseResultMap" columnPrefix="SpmkApprovalTemplate_">
resultMap="cn.timer.api.dao.spmk.SpmkApprovalTemplateMapper.BaseResultMap" columnPrefix="SpmkApprovalTemplate_">
</collection>
</resultMap>
......@@ -36,29 +34,36 @@
update_time SpmkApprovalTemplateG_update_time
</sql>
<sql id="Base_Column_List_Alias_a">
a.id,
a.name,
a.ranks,
a.update_time
</sql>
<sql id="Base_Column_List_Alias_at">
id SpmkApprovalTemplate_id,
approval_template_g_id SpmkApprovalTemplate_approval_template_g_id,
icon_url SpmkApprovalTemplate_icon_url,
name SpmkApprovalTemplate_name,
description SpmkApprovalTemplate_description,
is_open SpmkApprovalTemplate_is_open,
ranks SpmkApprovalTemplate_ranks,
is_opinion SpmkApprovalTemplate_is_opinion,
update_time SpmkApprovalTemplate_update_time,
create_time SpmkApprovalTemplate_create_time,
asso_type SpmkApprovalTemplate_asso_type,
froms SpmkApprovalTemplate_froms,
router SpmkApprovalTemplate_router
b.id SpmkApprovalTemplate_id,
b.approval_template_g_id SpmkApprovalTemplate_approval_template_g_id,
b.icon_url SpmkApprovalTemplate_icon_url,
b.name SpmkApprovalTemplate_name,
b.description SpmkApprovalTemplate_description,
b.is_open SpmkApprovalTemplate_is_open,
b.ranks SpmkApprovalTemplate_ranks,
b.is_opinion SpmkApprovalTemplate_is_opinion,
b.update_time SpmkApprovalTemplate_update_time,
b.create_time SpmkApprovalTemplate_create_time,
b.asso_type SpmkApprovalTemplate_asso_type,
b.froms SpmkApprovalTemplate_froms,
b.router SpmkApprovalTemplate_router
</sql>
<select id="selectListAtInAtg" resultMap="BaseResultMapDto">
SELECT
<include refid="Base_Column_List_Alias" />,
<include refid="Base_Column_List_Alias_a" />,
<include refid="Base_Column_List_Alias_at" />
FROM spmk_approval_template_g a
LEFT JOIN spmk_approval_template b IN a.id = b.approval_template_g_id
LEFT JOIN spmk_approval_template b ON a.id = b.approval_template_g_id
ORDER BY a.ranks, b.ranks
</select>
<update id="updateListRandsById" parameterType="list">
......
......@@ -5,7 +5,6 @@
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkApprovalTemplate" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="approval_template_g_id" property="approvalTemplateGId" />
<result column="icon_url" property="iconUrl" />
<result column="name" property="name" />
......
<?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="cn.timer.api.dao.spmk.SpmkApproveSummaryMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkApproveSummary" >
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="emp_num" property="empNum" />
<result column="title" property="title" />
<result column="department_name" property="departmentName" />
<result column="initiator" property="initiator" />
<result column="create_time" property="createTime" />
<result column="approve_name" property="approveName" />
<result column="sts" property="sts" />
<result column="current_approver" property="currentApprover" />
<result column="history_approver" property="historyApprover" />
<result column="update_time" property="updateTime" />
<result column="end_time" property="endTime" />
<result column="digest" property="digest" />
</resultMap>
<sql id="Base_Column_List">
id,
org_code,
emp_num,
title,
department_name,
initiator,
create_time,
approve_name,
sts,
current_approver,
history_approver,
update_time,
end_time,
digest
</sql>
<sql id="Base_Column_List_a">
a.id,
a.org_code,
a.emp_num,
a.title,
a.department_name,
a.initiator,
a.create_time,
a.approve_name,
a.sts,
a.current_approver,
a.history_approver,
a.update_time,
a.end_time,
a.digest
</sql>
<sql id="Base_Column_List_Alias">
id SpmkApproveSummary_id,
org_code SpmkApproveSummary_org_code,
emp_num SpmkApproveSummary_emp_num,
title SpmkApproveSummary_title,
department_name SpmkApproveSummary_department_name,
initiator SpmkApproveSummary_initiator,
create_time SpmkApproveSummary_create_time,
approve_name SpmkApproveSummary_approve_name,
sts SpmkApproveSummary_sts,
current_approver SpmkApproveSummary_current_approver,
history_approver SpmkApproveSummary_history_approver,
update_time SpmkApproveSummary_update_time,
end_time SpmkApproveSummary_end_time,
digest SpmkApproveSummary_digest
</sql>
<select id="selectPageByQuery" resultMap="BaseResultMap" >
SELECT
<include refid="Base_Column_List_a" />,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num)) as gw_name,
(SELECT id FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num) )) as bm_id,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num) )) as bm_name
FROM spmk_approve_summary a
WHERE 1 = 1
<if test="param.query != null and param.query != ''">
and (
a.title like CONCAT(#{param.query},'%') or
a.initiator like CONCAT(#{param.query},'%') or
a.id like CONCAT(#{param.query},'%')
)
</if>
<if test="param.startTime != null and param.startTime != ''">
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and qlb.create_time <![CDATA[ <= ]]> #{param.endTime}
</if>
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkApproveSummary">
INSERT INTO spmk_approve_summary
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != orgCode'>
org_code,
</if>
<if test ='null != empNum'>
emp_num,
</if>
<if test ='null != title'>
title,
</if>
<if test ='null != departmentName'>
department_name,
</if>
<if test ='null != initiator'>
initiator,
</if>
<if test ='null != createTime'>
create_time,
</if>
<if test ='null != approveName'>
approve_name,
</if>
<if test ='null != sts'>
sts,
</if>
<if test ='null != currentApprover'>
current_approver,
</if>
<if test ='null != historyApprover'>
history_approver,
</if>
<if test ='null != updateTime'>
update_time,
</if>
<if test ='null != endTime'>
end_time,
</if>
<if test ='null != digest'>
digest
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != orgCode'>
#{orgCode},
</if>
<if test ='null != empNum'>
#{empNum},
</if>
<if test ='null != title'>
#{title},
</if>
<if test ='null != departmentName'>
#{departmentName},
</if>
<if test ='null != initiator'>
#{initiator},
</if>
<if test ='null != createTime'>
#{createTime},
</if>
<if test ='null != approveName'>
#{approveName},
</if>
<if test ='null != sts'>
#{sts},
</if>
<if test ='null != currentApprover'>
#{currentApprover},
</if>
<if test ='null != historyApprover'>
#{historyApprover},
</if>
<if test ='null != updateTime'>
#{updateTime},
</if>
<if test ='null != endTime'>
#{endTime},
</if>
<if test ='null != digest'>
#{digest}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM spmk_approve_summary
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.spmk.SpmkApproveSummary">
UPDATE spmk_approve_summary
<set>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != empNum'>emp_num = #{empNum},</if>
<if test ='null != title'>title = #{title},</if>
<if test ='null != departmentName'>department_name = #{departmentName},</if>
<if test ='null != initiator'>initiator = #{initiator},</if>
<if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != approveName'>approve_name = #{approveName},</if>
<if test ='null != sts'>sts = #{sts},</if>
<if test ='null != currentApprover'>current_approver = #{currentApprover},</if>
<if test ='null != historyApprover'>history_approver = #{historyApprover},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != endTime'>end_time = #{endTime},</if>
<if test ='null != digest'>digest = #{digest}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_approve_summary
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM spmk_approve_summary
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM spmk_approve_summary
</select>
-->
</mapper>
\ No newline at end of file
......@@ -5,7 +5,6 @@
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkCustomApproval" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="approval_g_id" property="approvalGId" />
<result column="icon_url" property="iconUrl" />
......
......@@ -5,7 +5,6 @@
<resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkInitiatorConfig" >
<id column="id" property="id" />
<id column="id" property="id" />
<result column="custom_approval_id" property="customApprovalId" />
<result column="asso_id" property="assoId" />
<result column="type" property="type" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment