Browse Source

图标0601

master
zy_Java 5 years ago
parent
commit
ca1e15b689
  1. 26
      tall/src/main/java/com/ccsens/tall/bean/dto/ChartDto.java
  2. 5
      tall/src/main/java/com/ccsens/tall/bean/dto/LabelDto.java
  3. 11
      tall/src/main/java/com/ccsens/tall/bean/po/ProShow.java
  4. 70
      tall/src/main/java/com/ccsens/tall/bean/po/ProShowExample.java
  5. 199
      tall/src/main/java/com/ccsens/tall/bean/po/SysPlugin.java
  6. 1340
      tall/src/main/java/com/ccsens/tall/bean/po/SysPluginExample.java
  7. 107
      tall/src/main/java/com/ccsens/tall/bean/vo/ChartVo.java
  8. 4
      tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java
  9. 10
      tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java
  10. 3
      tall/src/main/java/com/ccsens/tall/config/SpringConfig.java
  11. 4
      tall/src/main/java/com/ccsens/tall/persist/dao/SysLabelDao.java
  12. 18
      tall/src/main/java/com/ccsens/tall/persist/dao/SysProjectDao.java
  13. 59
      tall/src/main/java/com/ccsens/tall/persist/mapper/SysPluginMapper.java
  14. 135
      tall/src/main/java/com/ccsens/tall/service/ChartService.java
  15. 19
      tall/src/main/java/com/ccsens/tall/service/IChartService.java
  16. 8
      tall/src/main/java/com/ccsens/tall/service/ILabelService.java
  17. 69
      tall/src/main/java/com/ccsens/tall/service/LabelService.java
  18. 9
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  19. 13
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  20. 86
      tall/src/main/java/com/ccsens/tall/web/ChartController.java
  21. 22
      tall/src/main/java/com/ccsens/tall/web/LabelController.java
  22. 20
      tall/src/main/java/com/ccsens/tall/web/ProjectController.java
  23. 6
      tall/src/main/resources/mapper_dao/SysLabelDao.xml
  24. 221
      tall/src/main/resources/mapper_dao/SysProjectDao.xml
  25. 5
      tall/src/main/resources/mapper_dao/SysUserDao.xml
  26. 37
      tall/src/main/resources/mapper_dao/TaskDetailDao.xml
  27. 25
      tall/src/main/resources/mapper_raw/ProShowMapper.xml
  28. 499
      tall/src/main/resources/mapper_raw/SysPluginMapper.xml
  29. 2
      util/src/main/java/com/ccsens/util/StringUtil.java

26
tall/src/main/java/com/ccsens/tall/bean/dto/ChartDto.java

@ -0,0 +1,26 @@
package com.ccsens.tall.bean.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class ChartDto {
@Data
public static class ProjectTrendDto{
@NotNull
@ApiModelProperty("项目id")
private Long projectId;
@NotEmpty
@ApiModelProperty("开始日期")
private String start;
@NotEmpty
@ApiModelProperty("结束日期")
private String end;
@ApiModelProperty("角色id")
private Long roleId;
}
}

5
tall/src/main/java/com/ccsens/tall/bean/dto/LabelDto.java

@ -13,11 +13,12 @@ public class LabelDto {
@Data
@ApiModel("添加标签")
public static class AddLabel{
@NotEmpty
@NotEmpty(message = "请输入标签名")
@ApiModelProperty("标签名")
private String name;
@ApiModelProperty("标签code")
private String code;
@NotEmpty(message = "请选择颜色")
@ApiModelProperty("颜色")
private String color;
@ApiModelProperty("备注信息")
@ -57,7 +58,7 @@ public class LabelDto {
@NotNull
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("项目id")
@ApiModelProperty("标签id")
private List<Long> labelList;
}
}

11
tall/src/main/java/com/ccsens/tall/bean/po/ProShow.java

@ -30,6 +30,8 @@ public class ProShow implements Serializable {
private Byte selectTaskType;
private String detailPath;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -136,6 +138,14 @@ public class ProShow implements Serializable {
this.selectTaskType = selectTaskType;
}
public String getDetailPath() {
return detailPath;
}
public void setDetailPath(String detailPath) {
this.detailPath = detailPath == null ? null : detailPath.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -155,6 +165,7 @@ public class ProShow implements Serializable {
sb.append(", duration=").append(duration);
sb.append(", showShortcuts=").append(showShortcuts);
sb.append(", selectTaskType=").append(selectTaskType);
sb.append(", detailPath=").append(detailPath);
sb.append("]");
return sb.toString();
}

70
tall/src/main/java/com/ccsens/tall/bean/po/ProShowExample.java

@ -894,6 +894,76 @@ public class ProShowExample {
addCriterion("select_task_type not between", value1, value2, "selectTaskType");
return (Criteria) this;
}
public Criteria andDetailPathIsNull() {
addCriterion("detail_path is null");
return (Criteria) this;
}
public Criteria andDetailPathIsNotNull() {
addCriterion("detail_path is not null");
return (Criteria) this;
}
public Criteria andDetailPathEqualTo(String value) {
addCriterion("detail_path =", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathNotEqualTo(String value) {
addCriterion("detail_path <>", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathGreaterThan(String value) {
addCriterion("detail_path >", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathGreaterThanOrEqualTo(String value) {
addCriterion("detail_path >=", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathLessThan(String value) {
addCriterion("detail_path <", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathLessThanOrEqualTo(String value) {
addCriterion("detail_path <=", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathLike(String value) {
addCriterion("detail_path like", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathNotLike(String value) {
addCriterion("detail_path not like", value, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathIn(List<String> values) {
addCriterion("detail_path in", values, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathNotIn(List<String> values) {
addCriterion("detail_path not in", values, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathBetween(String value1, String value2) {
addCriterion("detail_path between", value1, value2, "detailPath");
return (Criteria) this;
}
public Criteria andDetailPathNotBetween(String value1, String value2) {
addCriterion("detail_path not between", value1, value2, "detailPath");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

199
tall/src/main/java/com/ccsens/tall/bean/po/SysPlugin.java

@ -1,95 +1,106 @@
package com.ccsens.tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysPlugin implements Serializable {
private Long id;
private String name;
private String description;
private Byte scene;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Byte getScene() {
return scene;
}
public void setScene(Byte scene) {
this.scene = scene;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", scene=").append(scene);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
package com.ccsens.tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysPlugin implements Serializable {
private Long id;
private String name;
private String description;
private Byte scene;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private Byte showType;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Byte getScene() {
return scene;
}
public void setScene(Byte scene) {
this.scene = scene;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
public Byte getShowType() {
return showType;
}
public void setShowType(Byte showType) {
this.showType = showType;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", scene=").append(scene);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", showType=").append(showType);
sb.append("]");
return sb.toString();
}
}

1340
tall/src/main/java/com/ccsens/tall/bean/po/SysPluginExample.java

File diff suppressed because it is too large

107
tall/src/main/java/com/ccsens/tall/bean/vo/ChartVo.java

@ -0,0 +1,107 @@
package com.ccsens.tall.bean.vo;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ChartVo {
@Data
public static class ExecutorChart{
@ApiModelProperty("查询类型")
private int type;
@ApiModelProperty("查询类型")
private List<__ExecutorChart> executorChart;
}
@Data
public static class __ExecutorChart{
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("角色名")
private String roleName;
@ApiModelProperty("value")
private Integer value;
}
@Data
public static class CompleteTaskNum{
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("角色名")
private String roleName;
@ApiModelProperty("完成数量")
private Integer value;
@ApiModelProperty("任务总数")
private Integer total;
}
@Data
public static class ProjectTrendVo {
@ApiModelProperty("日期")
private String date;
@ApiModelProperty("当天任务总数")
private Integer total;
@ApiModelProperty("当天已完成的任务数")
private Integer completed;
}
@Data
public static class ProjectOverview {
@ApiModelProperty("任务总数")
private Integer total;
@ApiModelProperty("已完成的任务数")
private Integer completed;
@ApiModelProperty("未完成的任务数")
private Integer undone;
@ApiModelProperty("按时完成")
private Integer completedOnTime;
@ApiModelProperty("逾期完成")
private Integer completedOverTime;
@ApiModelProperty("今天任务总数")
private Integer today;
@ApiModelProperty("今日已完成")
private Integer todayCompleted;
@ApiModelProperty("今日未完成")
private Integer todayUndone;
public Integer getUndone(){
if(ObjectUtil.isNotNull(total) && ObjectUtil.isNotNull(completed)){
return total - completed;
}
return null;
}
public Integer getCompletedOverTime(){
if(ObjectUtil.isNotNull(completed) && ObjectUtil.isNotNull(completedOnTime)){
return completed - completedOnTime;
}
return null;
}
}
@Data
public static class BurnoutFigure {
@ApiModelProperty("日期 MM-DD")
private String date;
@ApiModelProperty("理想的剩余任务数,回出现小数 保留1位小数")
private BigDecimal ideal;
@ApiModelProperty("计划的剩余任务数")
private Integer planned;
@ApiModelProperty("实际的剩余任务数")
private Integer realistic;
@JsonIgnore//任务总数
private Integer total;
@JsonIgnore//每天的任务数
private Integer totalDay;
@JsonIgnore//每天完成的任务数量
private Integer completed;
}
}

4
tall/src/main/java/com/ccsens/tall/bean/vo/ProjectVo.java

@ -96,9 +96,11 @@ public class ProjectVo {
@ApiModelProperty("是否展示MVP 0:不展示 1:展示")
private int showMvp = 1;
@JsonIgnore//0日程,1天,2周,3月
private int selectTaskType = 0;
private int selectTaskType = 1;
@ApiModelProperty("查询任务类型")
private String selectType;
@ApiModelProperty("第三列展示页面的路径")
private String detailPath = "/project";
public String getSelectType(){
if(ObjectUtil.isNull(selectTaskType)) {

10
tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java

@ -96,12 +96,6 @@ public class TaskVo {
private Long endTime;
@ApiModelProperty("时长")
private Long duration;
// @ApiModelProperty("显示的日期格式")
// private String showTimeFormat;
// @ApiModelProperty("是否展示快捷方式(交付物硬件按钮)0不展示 1展示")
// private int showShortcuts;
// @ApiModelProperty("是否展示添加任务的按钮 0不展示 1展示")
// private int createTask;
@ApiModelProperty("循环周期")
private String cycle;
@ApiModelProperty("跳转模式 0自动,1延迟,2手动")
@ -120,6 +114,8 @@ public class TaskVo {
private BigDecimal money;
@ApiModelProperty("状态:0-未开始,1-进行中,2-已完成")
private int process;
@ApiModelProperty("子项目id")
private Long subProjectId;
@ApiModelProperty("服务器时间")
private Long serverTime;
@ApiModelProperty("任务类型 0普通任务 1虚拟任务")
@ -213,6 +209,8 @@ public class TaskVo {
private String name;
@ApiModelProperty("插件描述")
private String description;
@ApiModelProperty("显示分类")
private String showType;
@JsonIgnore
private Long roleId;
}

3
tall/src/main/java/com/ccsens/tall/config/SpringConfig.java

@ -154,7 +154,8 @@ public class SpringConfig implements WebMvcConfigurer {
.addPathPatterns("/members/**")
.addPathPatterns("/templates/**")
.addPathPatterns("/hardware/**")
.addPathPatterns("/labels/**");
.addPathPatterns("/labels/**")
.addPathPatterns("/charts/**");
//super.addInterceptors(registry);
}

4
tall/src/main/java/com/ccsens/tall/persist/dao/SysLabelDao.java

@ -9,7 +9,7 @@ import java.util.List;
@Repository
public interface SysLabelDao extends SysLabelMapper {
List<LabelVo.SelectLabel> selectLabelByUserId(@Param("userId")Long userId);
List<LabelVo.SelectLabel> selectLabelByUserId(@Param("userId")Long userId,@Param("key")String key);
List<LabelVo.SelectLabel> selectLabelByProjectId(@Param("projectId")Long projectId);
List<LabelVo.SelectLabel> selectLabelByProjectId(@Param("userId")Long userId,@Param("projectId")Long projectId);
}

18
tall/src/main/java/com/ccsens/tall/persist/dao/SysProjectDao.java

@ -1,6 +1,7 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.bean.po.SysProject;
import com.ccsens.tall.bean.vo.ChartVo;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.persist.mapper.SysProjectMapper;
import org.apache.ibatis.annotations.Param;
@ -22,5 +23,20 @@ public interface SysProjectDao extends SysProjectMapper{
List<ProjectVo.ProjectInfo> selectByLabelName(@Param("userId")Long currentUserId, @Param("labelName")String labelName);
List<ProjectVo.RelevanceProject> selectRelevanceProject(@Param("labelName")Long projectId);
List<ProjectVo.RelevanceProject> selectRelevanceProject(@Param("projectId")Long projectId);
List<ChartVo.__ExecutorChart> getExecutorChart(@Param("projectId")Long projectId,@Param("type")Integer type);
List<ChartVo.CompleteTaskNum> getCompleteTaskByTime(@Param("projectId")Long projectId);
List<ChartVo.ProjectTrendVo> getProjectTrend(@Param("projectId")Long projectId, @Param("start")Long start, @Param("end")Long end, @Param("roleId")Long roleId);
ChartVo.ProjectOverview getOverview(@Param("projectId")Long projectId);
List<ChartVo.BurnoutFigure> getBurnoutFigure(@Param("projectId")Long projectId,
@Param("start")Long start, @Param("end")Long end,
@Param("roleId")Long roleIdm,@Param("type") Integer type);
Integer getTaskTotalByProjectId(@Param("projectId")Long projectId, @Param("start")Long start, @Param("end")Long end, @Param("roleId")Long roleId);
}

59
tall/src/main/java/com/ccsens/tall/persist/mapper/SysPluginMapper.java

@ -1,31 +1,30 @@
package com.ccsens.tall.persist.mapper;
import com.ccsens.tall.bean.po.SysPlugin;
import com.ccsens.tall.bean.po.SysPluginExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysPluginMapper {
long countByExample(SysPluginExample example);
int deleteByExample(SysPluginExample example);
int deleteByPrimaryKey(Long id);
int insert(SysPlugin record);
int insertSelective(SysPlugin record);
List<SysPlugin> selectByExample(SysPluginExample example);
SysPlugin selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysPlugin record, @Param("example") SysPluginExample example);
int updateByExample(@Param("record") SysPlugin record, @Param("example") SysPluginExample example);
int updateByPrimaryKeySelective(SysPlugin record);
int updateByPrimaryKey(SysPlugin record);
package com.ccsens.tall.persist.mapper;
import com.ccsens.tall.bean.po.SysPlugin;
import com.ccsens.tall.bean.po.SysPluginExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysPluginMapper {
long countByExample(SysPluginExample example);
int deleteByExample(SysPluginExample example);
int deleteByPrimaryKey(Long id);
int insert(SysPlugin record);
int insertSelective(SysPlugin record);
List<SysPlugin> selectByExample(SysPluginExample example);
SysPlugin selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysPlugin record, @Param("example") SysPluginExample example);
int updateByExample(@Param("record") SysPlugin record, @Param("example") SysPluginExample example);
int updateByPrimaryKeySelective(SysPlugin record);
int updateByPrimaryKey(SysPlugin record);
}

135
tall/src/main/java/com/ccsens/tall/service/ChartService.java

@ -0,0 +1,135 @@
package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.tall.bean.dto.ChartDto;
import com.ccsens.tall.bean.po.SysProject;
import com.ccsens.tall.bean.vo.ChartVo;
import com.ccsens.tall.persist.dao.SysProjectDao;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@Service
public class ChartService implements IChartService{
@Autowired
private SysProjectDao sysProjectDao;
/**
* 任务执行者分布图
* @param currentUserId
* @param type
* @return
*/
@Override
public ChartVo.ExecutorChart getExecutorChart(Long currentUserId,Long projectId,Integer type) {
SysProject sysProject = sysProjectDao.selectByPrimaryKey(projectId);
if(ObjectUtil.isNull(sysProject)){
throw new BaseException(CodeEnum.NOT_PROJECT);
}
List<ChartVo.__ExecutorChart> executorChartList = sysProjectDao.getExecutorChart(projectId,type);
ChartVo.ExecutorChart executorChart = new ChartVo.ExecutorChart();
executorChart.setType(type);
executorChart.setExecutorChart(executorChartList);
return executorChart;
}
/**
* 计划时间内完成任务
* @param currentUserId
* @param projectId
* @return
*/
@Override
public List<ChartVo.CompleteTaskNum> getCompleteTaskByTime(Long currentUserId, Long projectId) {
//查找所有角色及任务数量
List<ChartVo.CompleteTaskNum> completeTaskNumList = sysProjectDao.getCompleteTaskByTime(projectId);
return completeTaskNumList;
}
/**
* 项目进展趋势图
* @param currentUserId
* @param projectTrendDto
* @return
*/
@Override
public List<ChartVo.ProjectTrendVo> getProjectTrend(Long currentUserId, ChartDto.ProjectTrendDto projectTrendDto) {
Long start = DateUtil.parse(projectTrendDto.getStart()).getTime();
Long end = DateUtil.parse(projectTrendDto.getEnd()).getTime();
List<ChartVo.ProjectTrendVo> projectTrendVoList = sysProjectDao.getProjectTrend(projectTrendDto.getProjectId(),start,end,projectTrendDto.getRoleId());
return projectTrendVoList;
}
/**
* 概览报表
* @param currentUserId
* @param projectId
* @return
*/
@Override
public ChartVo.ProjectOverview getOverview(Long currentUserId, Long projectId) {
ChartVo.ProjectOverview projectOverview = sysProjectDao.getOverview(projectId);
return projectOverview;
}
/**
* 燃尽图
* @param currentUserId
* @param projectTrendDto
* @return
*/
@Override
public List<ChartVo.BurnoutFigure> getBurnoutFigure(Long currentUserId, ChartDto.ProjectTrendDto projectTrendDto) {
Long start = DateUtil.parse(projectTrendDto.getStart()).getTime();
Long end = DateUtil.parse(projectTrendDto.getEnd()).getTime();
//获取任务总数(如果type传1 查询规定条件内的任务总数,若传null,则按天分组查找)
List<ChartVo.BurnoutFigure> totalList = sysProjectDao.getBurnoutFigure(projectTrendDto.getProjectId(),start,end,projectTrendDto.getRoleId(),1);
//理想
AtomicReference<BigDecimal> idealTotal = new AtomicReference<>();
BigDecimal idealTotalInt = new BigDecimal(0);
//计划
AtomicInteger plannedTotal = new AtomicInteger();
//实际
AtomicInteger realTotal = new AtomicInteger();
if(CollectionUtil.isNotEmpty(totalList)) {
idealTotal.set(BigDecimal.valueOf(totalList.get(0).getTotalDay()));
idealTotalInt = BigDecimal.valueOf(totalList.get(0).getTotalDay());
plannedTotal.set(totalList.get(0).getTotalDay());
realTotal.set(totalList.get(0).getTotalDay());
}
//按天获取信息
List<ChartVo.BurnoutFigure> burnoutFigureList = sysProjectDao.getBurnoutFigure(projectTrendDto.getProjectId(),start,end,projectTrendDto.getRoleId(),null);
if(CollectionUtil.isNotEmpty(burnoutFigureList)){
//每天理想完成数,总数/天数=每天理想完成数
BigDecimal idealFinish = idealTotalInt.divide(BigDecimal.valueOf(burnoutFigureList.size()),1,BigDecimal.ROUND_HALF_UP);
burnoutFigureList.forEach(burnoutFigure -> {
//理想剩余数量
idealTotal.set(idealTotal.get().subtract(idealFinish));
if(idealTotal.get().compareTo(BigDecimal.valueOf(0)) < 1){
burnoutFigure.setIdeal(BigDecimal.valueOf(0));
}else {
burnoutFigure.setIdeal(idealTotal.get());
}
//计划剩余数量
plannedTotal.set(plannedTotal.get() - burnoutFigure.getTotalDay());
burnoutFigure.setPlanned(plannedTotal.get());
//实际剩余数量
if(ObjectUtil.isNotNull(burnoutFigure.getCompleted())){
realTotal.set(realTotal.get() - burnoutFigure.getCompleted());
burnoutFigure.setRealistic(realTotal.get());
}else{
burnoutFigure.setRealistic(realTotal.get());
}
});
}
return burnoutFigureList;
}
}

19
tall/src/main/java/com/ccsens/tall/service/IChartService.java

@ -0,0 +1,19 @@
package com.ccsens.tall.service;
import com.ccsens.tall.bean.dto.ChartDto;
import com.ccsens.tall.bean.vo.ChartVo;
import java.util.List;
public interface IChartService {
ChartVo.ExecutorChart getExecutorChart(Long currentUserId,Long projectId, Integer type);
List<ChartVo.CompleteTaskNum> getCompleteTaskByTime(Long currentUserId, Long projectId);
List<ChartVo.ProjectTrendVo> getProjectTrend(Long currentUserId, ChartDto.ProjectTrendDto projectTrendDto);
ChartVo.ProjectOverview getOverview(Long currentUserId, Long projectId);
List<ChartVo.BurnoutFigure> getBurnoutFigure(Long currentUserId, ChartDto.ProjectTrendDto projectTrendDto);
}

8
tall/src/main/java/com/ccsens/tall/service/ILabelService.java

@ -6,15 +6,15 @@ import com.ccsens.tall.bean.vo.LabelVo;
import java.util.List;
public interface ILabelService {
List<LabelVo.SelectLabel> addLabel(Long userId,List<LabelDto.AddLabel> labelList);
List<LabelVo.SelectLabel> addLabel(Long userId,LabelDto.AddLabel labelList);
List<LabelVo.SelectLabel> selectLabel(Long currentUserId);
List<LabelVo.SelectLabel> selectLabel(Long currentUserId,String key);
void delLabel(Long currentUserId, LabelDto.DelLabel delLabel);
void changeLabel(Long currentUserId, LabelDto.ChangeLabel changeLabel);
void projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
List<LabelVo.SelectLabel> projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
void projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
List<LabelVo.SelectLabel> projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel);
}

69
tall/src/main/java/com/ccsens/tall/service/LabelService.java

@ -17,6 +17,7 @@ import com.ccsens.util.exception.BaseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
@ -34,26 +35,24 @@ public class LabelService implements ILabelService{
/**
* 添加标签
* @param labelList 添加的标签信息
* @param label 添加的标签信息
*/
@Override
public List<LabelVo.SelectLabel> addLabel(Long userId,List<LabelDto.AddLabel> labelList) {
if(CollectionUtil.isNotEmpty(labelList)){
labelList.forEach(label->{
SysLabelExample sysLabelExample = new SysLabelExample();
sysLabelExample.createCriteria().andNameEqualTo(label.getName());
List<SysLabel> sysLabels = sysLabelDao.selectByExample(sysLabelExample);
if(CollectionUtil.isNotEmpty(sysLabels)){
throw new BaseException(CodeEnum.REPEAT_LABEL);
}
SysLabel sysLabel = new SysLabel();
sysLabel.setId(snowflake.nextId());
sysLabel.setUserId(userId);
BeanUtil.copyProperties(label,sysLabel);
sysLabelDao.insertSelective(sysLabel);
});
public List<LabelVo.SelectLabel> addLabel(Long userId,LabelDto.AddLabel label) {
if(ObjectUtil.isNotNull(label)){
SysLabelExample sysLabelExample = new SysLabelExample();
sysLabelExample.createCriteria().andNameEqualTo(label.getName()).andUserIdEqualTo(userId);
List<SysLabel> sysLabels = sysLabelDao.selectByExample(sysLabelExample);
if(CollectionUtil.isNotEmpty(sysLabels)){
throw new BaseException(CodeEnum.REPEAT_LABEL);
}
SysLabel sysLabel = new SysLabel();
sysLabel.setId(snowflake.nextId());
sysLabel.setUserId(userId);
BeanUtil.copyProperties(label,sysLabel);
sysLabelDao.insertSelective(sysLabel);
}
return sysLabelDao.selectLabelByUserId(userId);
return sysLabelDao.selectLabelByUserId(userId,null);
}
/**
@ -62,8 +61,8 @@ public class LabelService implements ILabelService{
* @return 返回该用户添加的所有标签
*/
@Override
public List<LabelVo.SelectLabel> selectLabel(Long currentUserId) {
return sysLabelDao.selectLabelByUserId(currentUserId);
public List<LabelVo.SelectLabel> selectLabel(Long currentUserId,String key) {
return sysLabelDao.selectLabelByUserId(currentUserId,key);
}
/**
@ -123,12 +122,13 @@ public class LabelService implements ILabelService{
* @param projectLabel 项目id和标签id
*/
@Override
public void projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
public List<LabelVo.SelectLabel> projectAddLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
List<LabelVo.SelectLabel> selectLabelList = new ArrayList<>();
SysProject project = sysProjectDao.selectByPrimaryKey(projectLabel.getProjectId());
if (ObjectUtil.isNotNull(project)) {
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
if (power > 1) {
// int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
// if (power > 1) {
if(CollectionUtil.isNotEmpty(projectLabel.getLabelList())){
projectLabel.getLabelList().forEach(labelId->{
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
@ -146,12 +146,15 @@ public class LabelService implements ILabelService{
sysProjectLabelDao.insertSelective(sysProjectLabel);
});
}
} else {
throw new BaseException(CodeEnum.NOT_POWER);
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByProjectId(currentUserId,project.getId());
// } else {
// throw new BaseException(CodeEnum.NOT_POWER);
// }
} else {
throw new BaseException(CodeEnum.NOT_PROJECT);
}
return selectLabelList;
}
/**
@ -160,12 +163,13 @@ public class LabelService implements ILabelService{
* @param projectLabel 项目id和被删除的标签的id
*/
@Override
public void projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
public List<LabelVo.SelectLabel> projectRemoveLabel(Long currentUserId, LabelDto.ProjectLabel projectLabel) {
List<LabelVo.SelectLabel> selectLabelList = new ArrayList<>();
SysProject project = sysProjectDao.selectByPrimaryKey(projectLabel.getProjectId());
if (ObjectUtil.isNotNull(project)) {
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
if (power > 1) {
// int power = proRoleService.selectPowerByRoleName(currentUserId, projectLabel.getProjectId());
// if (power > 1) {
if(CollectionUtil.isNotEmpty(projectLabel.getLabelList())){
projectLabel.getLabelList().forEach(labelId -> {
SysLabel sysLabel = sysLabelDao.selectByPrimaryKey(labelId);
@ -187,11 +191,14 @@ public class LabelService implements ILabelService{
}
});
}
//查询项目内的标签信息
selectLabelList = sysLabelDao.selectLabelByProjectId(currentUserId,project.getId());
} else {
throw new BaseException(CodeEnum.NOT_POWER);
}
} else {
throw new BaseException(CodeEnum.NOT_PROJECT);
}
// } else {
// throw new BaseException(CodeEnum.NOT_PROJECT);
// }
return selectLabelList;
}
}

9
tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java

@ -23,6 +23,7 @@ import com.ccsens.util.cron.CronConstant;
import com.ccsens.util.cron.NatureToDate;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.apache.bcel.classfile.Code;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -453,6 +454,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
String[] pluginIds = pluginVo.getId().split(",");
String[] pluginNames = pluginVo.getName().split(",");
String[] pluginDescription = pluginVo.getDescription().split(",");
String[] pluginShowType = pluginVo.getShowType().split(",");
TaskVo.PluginVo plugin = null;
for(int i = 0;i<pluginIds.length;i++){
@ -460,6 +462,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
plugin.setId(pluginIds[i]);
plugin.setName(pluginNames[i]);
plugin.setDescription(pluginDescription[i]);
plugin.setShowType(pluginShowType[i]);
pluginVoList.add(plugin);
}
}
@ -929,7 +932,13 @@ public class ProTaskDetailService implements IProTaskDetailService {
public ProSubTimeMember getProcessByUserIdAndTask(Long userId, Long subTimeId) throws Exception {
ProSubTimeMember subTimeMember = null;
ProTaskSubTime subTime = taskSubTimeDao.selectByPrimaryKey(subTimeId);
if(ObjectUtil.isNull(subTime)){
throw new BaseException(CodeEnum.NOT_TASK);
}
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(subTime.getTaskDetailId());
if(ObjectUtil.isNull(taskDetail)){
throw new BaseException(CodeEnum.NOT_TASK);
}
if (taskDetail.getFinishNeedAll() == 0) {
ProSubTimeMemberExample subTimeMemberExample = new ProSubTimeMemberExample();
subTimeMemberExample.createCriteria().andTaskSubTimeIdEqualTo(subTimeId).andComplatedStatusEqualTo((byte) 2);

13
tall/src/main/java/com/ccsens/tall/service/ProjectService.java

@ -186,12 +186,10 @@ public class ProjectService implements IProjectService {
projectConfig.setFilter(proShowList.get(0).getFilter());
projectConfig.setShowMvp(proShowList.get(0).getIsShowMvp());
projectConfig.setSelectTaskType(proShowList.get(0).getSelectTaskType());
projectConfig.setDetailPath(proShowList.get(0).getDetailPath());
projectInfo.setProjectConfig(projectConfig);
} else {
ProjectVo.ProjectConfig projectConfig = new ProjectVo.ProjectConfig();
projectConfig.setFilter(0);
projectConfig.setSlide(0);
projectConfig.setCreateTask(1);
projectInfo.setProjectConfig(projectConfig);
}
});
@ -245,7 +243,7 @@ public class ProjectService implements IProjectService {
projectInfo.setProjectConfig(projectConfig);
}
//获取项目下的标签信息
List<LabelVo.SelectLabel> labelList = sysLabelDao.selectLabelByProjectId(project.getId());
List<LabelVo.SelectLabel> labelList = sysLabelDao.selectLabelByProjectId(currentUserId,project.getId());
if(CollectionUtil.isNotEmpty(labelList)){
projectInfo.setLabelList(labelList);
}
@ -301,16 +299,14 @@ public class ProjectService implements IProjectService {
projectConfig.setCreateTask(proShowList.get(0).getCreateTask());
projectConfig.setShowMvp(proShowList.get(0).getIsShowMvp());
projectConfig.setSelectTaskType(proShowList.get(0).getSelectTaskType());
projectConfig.setDetailPath(proShowList.get(0).getDetailPath());
projectInfo.setProjectConfig(projectConfig);
} else {
ProjectVo.ProjectConfig projectConfig = new ProjectVo.ProjectConfig();
projectConfig.setSlide(0);
projectConfig.setFilter(0);
projectConfig.setCreateTask(1);
projectInfo.setProjectConfig(projectConfig);
}
//获取项目下的标签信息
List<LabelVo.SelectLabel> labelList = sysLabelDao.selectLabelByProjectId(projectId);
List<LabelVo.SelectLabel> labelList = sysLabelDao.selectLabelByProjectId(userId,projectId);
if(CollectionUtil.isNotEmpty(labelList)){
projectInfo.setLabelList(labelList);
}
@ -329,7 +325,6 @@ public class ProjectService implements IProjectService {
PageHelper.startPage(1, 4);
List<ProjectVo.TemplateStatus> templateProject = sysProjectDao.selectByTemplateStatus(1);
PageHelper.startPage(1, 2);
List<ProjectVo.TemplateStatus> commonProject = sysProjectDao.selectByTemplateStatus(0);
// PageInfo pageInfo =new PageInfo<>(project);

86
tall/src/main/java/com/ccsens/tall/web/ChartController.java

@ -0,0 +1,86 @@
package com.ccsens.tall.web;
import com.ccsens.tall.bean.dto.ChartDto;
import com.ccsens.tall.bean.dto.TaskDto;
import com.ccsens.tall.bean.vo.ChartVo;
import com.ccsens.tall.bean.vo.TaskVo;
import com.ccsens.tall.service.IChartService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.*;
import jdk.internal.dynalink.linker.LinkerServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Api(tags = "图表相关API", description = "")
@RestController
@RequestMapping("/charts")
public class ChartController {
@Autowired
private IChartService chartService;
@ApiOperation(value = "任务执行者分布图",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/executor", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ChartVo.ExecutorChart> getTasksByTaskId(HttpServletRequest request,
@RequestParam(required = true)Long projectId,
@RequestParam(required = false)Integer type) throws Exception{
type = type == null ? 0 : type;
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
ChartVo.ExecutorChart executorChart = chartService.getExecutorChart(currentUserId,projectId,type);
return JsonResponse.newInstance().ok(executorChart);
}
@ApiOperation(value = "计划时间内完成任务",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/complete", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ChartVo.CompleteTaskNum>> getCompleteTaskByTime(HttpServletRequest request,
@RequestParam(required = true)Long projectId) throws Exception{
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<ChartVo.CompleteTaskNum> completeTaskNumList = chartService.getCompleteTaskByTime(currentUserId,projectId);
return JsonResponse.newInstance().ok(completeTaskNumList);
}
@ApiOperation(value = "项目进展趋势图",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/trend", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ChartVo.ProjectTrendVo>> getProjectTrend(HttpServletRequest request,
@Validated @RequestBody ChartDto.ProjectTrendDto projectTrendDto) throws Exception{
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<ChartVo.ProjectTrendVo> projectTrendVoList = chartService.getProjectTrend(currentUserId,projectTrendDto);
return JsonResponse.newInstance().ok(projectTrendVoList);
}
@ApiOperation(value = "概览报表",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/overview", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ChartVo.ProjectOverview> getOverview(HttpServletRequest request,
@RequestParam(required = true)Long projectId) throws Exception{
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
ChartVo.ProjectOverview projectOverview = chartService.getOverview(currentUserId,projectId);
return JsonResponse.newInstance().ok(projectOverview);
}
@ApiOperation(value = "燃尽图",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/burnout", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ChartVo.BurnoutFigure>> getBurnoutFigure(HttpServletRequest request,
@Validated @RequestBody ChartDto.ProjectTrendDto projectTrendDto) throws Exception{
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<ChartVo.BurnoutFigure> burnoutFigure = chartService.getBurnoutFigure(currentUserId,projectTrendDto);
return JsonResponse.newInstance().ok(burnoutFigure);
}
}

22
tall/src/main/java/com/ccsens/tall/web/LabelController.java

@ -4,6 +4,7 @@ import com.ccsens.tall.bean.dto.LabelDto;
import com.ccsens.tall.bean.dto.ProjectDto;
import com.ccsens.tall.bean.vo.DomainVo;
import com.ccsens.tall.bean.vo.LabelVo;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.service.ILabelService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
@ -30,9 +31,10 @@ public class LabelController {
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<LabelVo.SelectLabel>> selectLabel(HttpServletRequest request) throws Exception {
public JsonResponse<List<LabelVo.SelectLabel>> selectLabel(HttpServletRequest request,
@RequestParam(required = false)String key) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<LabelVo.SelectLabel> selectLabelList = labelService.selectLabel(currentUserId);
List<LabelVo.SelectLabel> selectLabelList = labelService.selectLabel(currentUserId,key);
return JsonResponse.newInstance().ok(selectLabelList);
}
@ -41,7 +43,7 @@ public class LabelController {
})
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<LabelVo.SelectLabel>> addLabel(HttpServletRequest request,
@Validated @RequestBody List<LabelDto.AddLabel> labelList ) throws Exception {
@Validated @RequestBody LabelDto.AddLabel labelList ) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<LabelVo.SelectLabel> selectLabelList = labelService.addLabel(currentUserId,labelList);
return JsonResponse.newInstance().ok(selectLabelList);
@ -73,22 +75,22 @@ public class LabelController {
@ApiImplicitParams({
})
@RequestMapping(value = "/project", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse projectAddLabel(HttpServletRequest request,
@Validated @RequestBody LabelDto.ProjectLabel projectLabel) throws Exception {
public JsonResponse<List<LabelVo.SelectLabel>> projectAddLabel(HttpServletRequest request,
@Validated @RequestBody LabelDto.ProjectLabel projectLabel) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
labelService.projectAddLabel(currentUserId,projectLabel);
return JsonResponse.newInstance().ok();
List<LabelVo.SelectLabel> selectLabelList = labelService.projectAddLabel(currentUserId,projectLabel);
return JsonResponse.newInstance().ok(selectLabelList);
}
@ApiOperation(value = "删除项目关联的标签",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/project/del", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse projectRemoveLabel(HttpServletRequest request,
public JsonResponse<List<LabelVo.SelectLabel>> projectRemoveLabel(HttpServletRequest request,
@Validated @RequestBody LabelDto.ProjectLabel projectLabel) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
labelService.projectRemoveLabel(currentUserId,projectLabel);
return JsonResponse.newInstance().ok();
List<LabelVo.SelectLabel> selectLabelList = labelService.projectRemoveLabel(currentUserId,projectLabel);
return JsonResponse.newInstance().ok(selectLabelList);
}
}

20
tall/src/main/java/com/ccsens/tall/web/ProjectController.java

@ -237,15 +237,15 @@ public class ProjectController {
return JsonResponse.newInstance().ok(projectInfoList);
}
// @ApiOperation(value = "查找关联的项目",notes = "")
// @ApiImplicitParams({
// })
// @RequestMapping(value = "/relevance", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<List<ProjectVo.RelevanceProject>> selectRelevanceProject(HttpServletRequest request,
// @RequestParam(required = false) Long projectId) throws Exception {
// Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
// List<ProjectVo.RelevanceProject> projectInfoList = projectService.selectRelevanceProject(currentUserId,projectId);
// return JsonResponse.newInstance().ok(projectInfoList);
// }
@ApiOperation(value = "查找关联的项目",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/relevance", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.RelevanceProject>> selectRelevanceProject(HttpServletRequest request,
@RequestParam(required = true) Long projectId) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<ProjectVo.RelevanceProject> projectInfoList = projectService.selectRelevanceProject(currentUserId,projectId);
return JsonResponse.newInstance().ok(projectInfoList);
}
}

6
tall/src/main/resources/mapper_dao/SysLabelDao.xml

@ -8,6 +8,10 @@
rec_status = 0
and
user_id = #{userId}
<if test="key != null and key != ''">
and
`name` like concat('%',#{key},'%')
</if>
</select>
<select id="selectLabelByProjectId" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.LabelVo$SelectLabel">
@ -26,6 +30,8 @@
l.rec_status = 0
and
p.project_id = #{projectId}
and
l.user_id = #{userId}
</select>
</mapper>

221
tall/src/main/resources/mapper_dao/SysProjectDao.xml

@ -55,6 +55,15 @@
<result column="pName" property="name" />
</resultMap>
<!-- <resultMap id="ChartVo_CompleteTaskNum" type="com.ccsens.tall.bean.vo.ChartVo$CompleteTaskNum">-->
<!-- <id column="roleId" property="roleId" />-->
<!-- <result column="roleName" property="roleName" />-->
<!-- <result column="total" property="total" />-->
<!-- <collection property="taskDetailId" ofType="java.lang.Long">-->
<!-- <id column="dId" property="taskDetailId"/>-->
<!-- </collection>-->
<!-- </resultMap>-->
<select id="findProjectIdByUserId" parameterType="java.util.Map"
resultMap="resultMap_ProjectInfo">
SELECT
@ -208,17 +217,27 @@
<select id="selectRelevanceProject" parameterType="java.util.Map" resultMap="resultMap_Relevance_Project">
SELECT
*
p.id AS pId,
p.NAME AS pName,
p.address AS pAddress,
p.begin_time AS pBeginTime,
p.end_time AS pEndTime,
l.id as lId,
l.name as lName,
l.code as lCode,
l.color as lColor,
l.level as lLevle,
l.description as lDescription
FROM
t_sys_project p LEFT JOIN
(SELECT
r.relevance_project_id as rProjectId
FROM
t_sys_relevance_project r left JOIN t_sys_project sp ON r.project_id = sp.id
WHERE
r.project_id = #{projectId}
) t
on p.id = t.rProjectId left join t_sys_project_label pl on pl.project_id = p.id
(
SELECT
r.relevance_project_id as rProjectId
FROM
t_sys_relevance_project r left JOIN t_sys_project sp ON r.project_id = sp.id
WHERE
r.project_id = #{projectId}
) t
LEFT JOIN t_sys_project p on p.id = t.rProjectId left join t_sys_project_label pl on pl.project_id = p.id
left join t_sys_label l on pl.label_id = l.id
WHERE
p.rec_status = 0
@ -228,6 +247,188 @@
(pl.rec_status = 0 or pl.rec_status is null)
AND
p.template = 0
</select>
<select id="getExecutorChart" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$__ExecutorChart">
SELECT
r.id as roleId,
r.`name` as roleName,
if(#{type}=0,count(d.id),SUM(d.end_time - d.begin_time)/6000) as `value`
FROM
`t_pro_role` r LEFT JOIN `t_pro_task_detail` d on r.id = d.executor_role
WHERE
r.project_id = #{projectId}
and
(SELECT name FROM t_pro_role pr WHERE r.parent_id = pr.id) in ('PM','Member')
AND
r.name not IN ('观众','MVP')
GROUP BY r.`name`
</select>
<select id="getCompleteTaskByTime" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$CompleteTaskNum">
SELECT
r.id as roleId,
r.`name` as roleName,
d.`name` as dId,
count(d.id) as total,
sum(a.finish=1) as value
FROM
`t_pro_role` r LEFT JOIN `t_pro_task_detail` d on r.id = d.executor_role
LEFT JOIN(
SELECT
td.id as dId,
if(sum(t.isFinish) = 0,true,false) as finish
FROM
t_pro_task_detail td LEFT JOIN
(
SELECT
s.id as sId,
s.task_detail_id as sTaskId,
m.real_finish_time,
m.complated_status,
if(count(m.id)=0,true,FALSE) as isFinish
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_sub_time_member m on s.id = m.task_sub_time_id
WHERE
(
(
m.real_finish_time > s.begin_time
and
m.real_finish_time &lt;= s.end_time
and
m.complated_status = 2
)
or
(m.real_finish_time is null))
GROUP BY s.id
) t on td.id = t.sTaskId
WHERE
td.`level` in (2,3)
GROUP BY td.Id
) a on a.dId = d.id
WHERE
r.project_id = #{projectId}
and
d.`level` in (2,3)
and
(SELECT name FROM t_pro_role pr WHERE r.parent_id = pr.id) in ('PM','Member')
AND
r.name not IN ('观众','MVP')
GROUP BY r.`id`
</select>
<select id="getProjectTrend" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$ProjectTrendVo">
SELECT
FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d') as date,
count(s.id) as total,
sum(t.isFinish) as completed
FROM
t_pro_task_detail d LEFT JOIN t_pro_task_sub_time s on d.id = s.task_detail_id
LEFT JOIN
(
SELECT
st.id as sId,
st.task_detail_id,
m.real_finish_time,
m.complated_status,
m.id as mId,
if(count(m.id)=0,FALSE,true) as isFinish
FROM
t_pro_task_sub_time st LEFT JOIN t_pro_sub_time_member m on st.id = m.task_sub_time_id
WHERE
m.complated_status = 2
or
m.complated_status is null
GROUP BY st.id
) t on s.id = t.sId
WHERE
s.begin_time &lt; #{end}
AND
s.end_time &gt; #{start}
<if test="roleId != null">
and
d.executor_role = #{roleId}
</if>
and
d.project_id = #{projectId}
group by FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d')
</select>
<select id="getOverview" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$ProjectOverview">
SELECT
count(td.id) as total,
sum(t.isFinish) as completed,
sum(t.completedOnTime) as completedOnTime
FROM
t_pro_task_detail td LEFT JOIN
(
SELECT
st.id as sId,
st.task_detail_id as sTaskId,
if(count(m.id)=0,FALSE,true) as isFinish,
if(count(m.id)>0
and m.real_finish_time &gt; st.begin_time
and m.real_finish_time &lt;= st.end_time,true,false) as completedOnTime
FROM
t_pro_task_sub_time st LEFT JOIN t_pro_sub_time_member m on st.id = m.task_sub_time_id
WHERE
(m.complated_status = 2
or
m.complated_status is null)
GROUP BY st.id
) t on t.sTaskId = td.id
WHERE
td.project_id = #{projectId}
and
td.`level` in (2,3)
</select>
<select id="getBurnoutFigure" parameterType="java.util.Map" resultType="com.ccsens.tall.bean.vo.ChartVo$BurnoutFigure">
SELECT
<if test="type == null">
FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d') as `date`,
</if>
count(s.id) as totalDay,
t.completed as completed
FROM
t_pro_task_detail d LEFT JOIN t_pro_task_sub_time s on d.id = s.task_detail_id
LEFT JOIN
(
SELECT
count(s.id) as completed,
FROM_UNIXTIME(m.real_finish_time/1000,'%Y-%m-%d') as `finishTime`
FROM
t_pro_task_detail d LEFT JOIN t_pro_task_sub_time s on d.id = s.task_detail_id
LEFT JOIN t_pro_sub_time_member m on s.id = m.task_sub_time_id
WHERE
m.complated_status = 2
AND
s.begin_time &lt; #{end}
AND
s.end_time &gt; #{start}
<if test="roleId != null">
and
d.executor_role = #{roleId}
</if>
and
d.project_id = #{projectId}
group by FROM_UNIXTIME(m.real_finish_time/1000,'%Y-%m-%d')
) t on t.finishTime = FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d')
WHERE
s.begin_time &lt; #{end}
AND
s.end_time &gt; #{start}
<if test="roleId != null">
and
d.executor_role = #{roleId}
</if>
and
d.project_id = #{projectId}
<if test="type == null">
group by FROM_UNIXTIME(s.begin_time/1000,'%Y-%m-%d')
</if>
</select>
</mapper>

5
tall/src/main/resources/mapper_dao/SysUserDao.xml

@ -76,9 +76,10 @@
AND a.identify_type = 3
WHERE
u.rec_status = 0
and
and
a.rec_status = 0
and
and
u.id = #{userId}
limit 1
</select>
</mapper>

37
tall/src/main/resources/mapper_dao/TaskDetailDao.xml

@ -27,6 +27,7 @@
<result column="tRealBeginTime" property="realBeginTime" />
<result column="tRealEndTime" property="realEndTime" />
<result column="tProcess" property="process" />
<result column="tSubProjectId" property="subProjectId" />
<result column="tMoney" property="money" />
<result column="tVirtual" property="virtual" />
<result column="tDelay" property="delay" />
@ -38,6 +39,7 @@
<id column="pId" property="id"/>
<result column="pName" property="name"/>
<result column="pDescription" property="description"/>
<result column="pShowType" property="showType"/>
</collection>
</resultMap>
@ -57,7 +59,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -72,6 +75,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -82,7 +86,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
@ -130,7 +135,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -145,6 +151,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -155,7 +162,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
@ -200,7 +208,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -215,6 +224,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -222,7 +232,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
@ -251,7 +262,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -266,6 +278,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -273,7 +286,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
@ -329,7 +343,8 @@
*,
GROUP_CONCAT(t.p_id ORDER BY t.p_id) as pId,
GROUP_CONCAT(t.spName ORDER BY t.p_id) as pName,
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription
GROUP_CONCAT(t.spDescription ORDER BY t.spid) as pDescription,
GROUP_CONCAT(t.spShowType ORDER BY t.spid) as pShowType
FROM
(SELECT
d.id as tDetailId,
@ -344,6 +359,7 @@
s.real_begin_time as tRealBeginTime,
s.real_end_time as tRealEndTime,
s.complated_status as tProcess,
d.sub_project_id as tSubProjectId,
d.money as tMoney,
d.virtual as tVirtual,
d.delay as tDelay,
@ -351,7 +367,8 @@
sp.name as spName,
p.id as p_id,
sp.description as spDescription,
sp.id as spid
sp.id as spid,
sp.show_type as spShowType
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id

25
tall/src/main/resources/mapper_raw/ProShowMapper.xml

@ -15,6 +15,7 @@
<result column="duration" jdbcType="TINYINT" property="duration" />
<result column="show_shortcuts" jdbcType="TINYINT" property="showShortcuts" />
<result column="select_task_type" jdbcType="TINYINT" property="selectTaskType" />
<result column="detail_path" jdbcType="VARCHAR" property="detailPath" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -76,7 +77,7 @@
</sql>
<sql id="Base_Column_List">
id, project_id, slide, filter, is_show_mvp, create_task, created_at, updated_at,
rec_status, time_show, duration, show_shortcuts, select_task_type
rec_status, time_show, duration, show_shortcuts, select_task_type, detail_path
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProShowExample" resultMap="BaseResultMap">
select
@ -113,12 +114,12 @@
filter, is_show_mvp, create_task,
created_at, updated_at, rec_status,
time_show, duration, show_shortcuts,
select_task_type)
select_task_type, detail_path)
values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{slide,jdbcType=TINYINT},
#{filter,jdbcType=TINYINT}, #{isShowMvp,jdbcType=TINYINT}, #{createTask,jdbcType=TINYINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT},
#{timeShow,jdbcType=VARCHAR}, #{duration,jdbcType=TINYINT}, #{showShortcuts,jdbcType=TINYINT},
#{selectTaskType,jdbcType=TINYINT})
#{selectTaskType,jdbcType=TINYINT}, #{detailPath,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProShow">
insert into t_pro_show
@ -162,6 +163,9 @@
<if test="selectTaskType != null">
select_task_type,
</if>
<if test="detailPath != null">
detail_path,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -203,6 +207,9 @@
<if test="selectTaskType != null">
#{selectTaskType,jdbcType=TINYINT},
</if>
<if test="detailPath != null">
#{detailPath,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.ProShowExample" resultType="java.lang.Long">
@ -253,6 +260,9 @@
<if test="record.selectTaskType != null">
select_task_type = #{record.selectTaskType,jdbcType=TINYINT},
</if>
<if test="record.detailPath != null">
detail_path = #{record.detailPath,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -272,7 +282,8 @@
time_show = #{record.timeShow,jdbcType=VARCHAR},
duration = #{record.duration,jdbcType=TINYINT},
show_shortcuts = #{record.showShortcuts,jdbcType=TINYINT},
select_task_type = #{record.selectTaskType,jdbcType=TINYINT}
select_task_type = #{record.selectTaskType,jdbcType=TINYINT},
detail_path = #{record.detailPath,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -316,6 +327,9 @@
<if test="selectTaskType != null">
select_task_type = #{selectTaskType,jdbcType=TINYINT},
</if>
<if test="detailPath != null">
detail_path = #{detailPath,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -332,7 +346,8 @@
time_show = #{timeShow,jdbcType=VARCHAR},
duration = #{duration,jdbcType=TINYINT},
show_shortcuts = #{showShortcuts,jdbcType=TINYINT},
select_task_type = #{selectTaskType,jdbcType=TINYINT}
select_task_type = #{selectTaskType,jdbcType=TINYINT},
detail_path = #{detailPath,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

499
tall/src/main/resources/mapper_raw/SysPluginMapper.xml

@ -1,243 +1,258 @@
<?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.ccsens.tall.persist.mapper.SysPluginMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.SysPlugin">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="scene" jdbcType="TINYINT" property="scene" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, description, scene, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_sys_plugin
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_sys_plugin
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample">
delete from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin (id, name, description,
scene, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{scene,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="description != null">
description,
</if>
<if test="scene != null">
scene,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="scene != null">
#{scene,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample" resultType="java.lang.Long">
select count(*) from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_sys_plugin
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.scene != null">
scene = #{record.scene,jdbcType=TINYINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_sys_plugin
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
scene = #{record.scene,jdbcType=TINYINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.SysPlugin">
update t_sys_plugin
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="scene != null">
scene = #{scene,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.SysPlugin">
update t_sys_plugin
set name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
scene = #{scene,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
<?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.ccsens.tall.persist.mapper.SysPluginMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.SysPlugin">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="scene" jdbcType="TINYINT" property="scene" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="show_type" jdbcType="TINYINT" property="showType" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, description, scene, created_at, updated_at, rec_status, show_type
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_sys_plugin
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_sys_plugin
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample">
delete from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin (id, name, description,
scene, created_at, updated_at,
rec_status, show_type)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{scene,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT}, #{showType,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="description != null">
description,
</if>
<if test="scene != null">
scene,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
<if test="showType != null">
show_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="scene != null">
#{scene,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
<if test="showType != null">
#{showType,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample" resultType="java.lang.Long">
select count(*) from t_sys_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_sys_plugin
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.scene != null">
scene = #{record.scene,jdbcType=TINYINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
<if test="record.showType != null">
show_type = #{record.showType,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_sys_plugin
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
scene = #{record.scene,jdbcType=TINYINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT},
show_type = #{record.showType,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.SysPlugin">
update t_sys_plugin
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="scene != null">
scene = #{scene,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="showType != null">
show_type = #{showType,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.SysPlugin">
update t_sys_plugin
set name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
scene = #{scene,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT},
show_type = #{showType,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

2
util/src/main/java/com/ccsens/util/StringUtil.java

@ -13,7 +13,7 @@ import java.util.regex.Pattern;
public class StringUtil {
public final static String WEEK_DAY = "(每?隔\\d周)|(每?隔\\d星期)|(每?周[0-7]+)|(每?星期[0-7]+)|(每?周一)|(每?周二)|(每?周三)|(每?周四)|(每?周五)|(每?周六)|(每?周日)|(每?周天)";
public final static String DAY = "(每?隔\\d+天)|(每?隔\\d+日)|(\\d+号)|(\\d+日)|(\\d+\\-\\d+号)|(\\d+\\-\\d+日)|(\\d+到\\d+号)|(\\d+到\\d+日)";
public final static String DAY = "(每\\d+天)|(每\\d+日)|(每?隔\\d+天)|(每?隔\\d+日)|(\\d+号)|(\\d+日)|(\\d+\\-\\d+号)|(\\d+\\-\\d+日)|(\\d+到\\d+号)|(\\d+到\\d+日)";
public final static String CONTINUE_RANGE = ".*(到|\\-|至).*";

Loading…
Cancel
Save