Commit 8a89a17f by tangzhaoqian Committed by chenzg

validation校验优化、审批搜索优化(审批汇总表加索引查询)

parent 80a28f85
...@@ -7,11 +7,7 @@ import java.util.List; ...@@ -7,11 +7,7 @@ import java.util.List;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature; import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature; import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import org.springframework.validation.BeanPropertyBindingResult; import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.ObjectError; import org.springframework.validation.ObjectError;
...@@ -25,12 +21,12 @@ import cn.timer.api.aspect.lang.bean.ValidationError; ...@@ -25,12 +21,12 @@ import cn.timer.api.aspect.lang.bean.ValidationError;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
/** /**
* 校验信息返回 * 校验信息返回-(闲置)
* *
* @author TZQ * @author TZQ
*/ */
@Aspect //@Aspect
@Component //@Component
public class BindingResultAspect { public class BindingResultAspect {
// @annotation配置织入点 // @annotation配置织入点
...@@ -40,7 +36,7 @@ public class BindingResultAspect { ...@@ -40,7 +36,7 @@ public class BindingResultAspect {
// } // }
// execution 配置织入点 -匹配 cn.timer.api.controller 包下的所有子包的类的方法 // execution 配置织入点 -匹配 cn.timer.api.controller 包下的所有子包的类的方法
@Pointcut("execution(* cn.timer.api.controller.spmk.*.*(..))") // @Pointcut("execution(* cn.timer.api.controller.spmk.*.*(..))")
public void clazzPointCut(){ public void clazzPointCut(){
} }
...@@ -53,45 +49,41 @@ public class BindingResultAspect { ...@@ -53,45 +49,41 @@ public class BindingResultAspect {
// } // }
// @Around("bindingResultPointCut() && args(..,bindingResult)") // @Around("bindingResultPointCut() && args(..,bindingResult)")
@Around("clazzPointCut()") // @Around("clazzPointCut()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable { // public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
Long startTime = System.currentTimeMillis(); // Long startTime = System.currentTimeMillis();
Object retVal; // Object retVal;
Object[] objs = joinPoint.getArgs(); // Object[] objs = joinPoint.getArgs();
List<Object> listObj = CollectionUtil.toList(objs); // List<Object> listObj = CollectionUtil.toList(objs);
BeanPropertyBindingResult optional = (BeanPropertyBindingResult)listObj.stream() // BeanPropertyBindingResult optional = (BeanPropertyBindingResult)listObj.stream()
.filter(p -> "BeanPropertyBindingResult".equals(ClassUtil.getClassName(p, true))) // .filter(p -> "BeanPropertyBindingResult".equals(ClassUtil.getClassName(p, true)))
.findFirst() // .findFirst()
.orElse(null); // .orElse(null);
if(optional != null && optional.hasErrors()){ // if(optional != null && optional.hasErrors()){
List<ObjectError> ls = optional.getAllErrors(); // List<ObjectError> ls = optional.getAllErrors();
List<ValidationError> listVe = new ArrayList<ValidationError>(); // List<ValidationError> listVe = new ArrayList<ValidationError>();
ValidationError ve; // ValidationError ve;
for (ObjectError one : ls) { // for (ObjectError one : ls) {
//
String fieldString = one.getCodes().length >= 1 ? one.getCodes()[0] : ""; // String fieldString = one.getCodes().length >= 1 ? one.getCodes()[0] : "";
if (fieldString != null) { // if (fieldString != null) {
fieldString = fieldString.substring(fieldString.lastIndexOf(".") + 1); // fieldString = fieldString.substring(fieldString.lastIndexOf(".") + 1);
} // }
//
// for (String str : one.getCodes()) { // ve = ValidationError.builder().field(fieldString).msg(one.getDefaultMessage()).build();
// System.err.println(str); // listVe.add(ve);
//
// }
// retVal = ResultUtil.error(listVe);
// }else {
// retVal = joinPoint.proceed(joinPoint.getArgs());
// }
// Console.log("返回内容 {}: " ,JSONObject.toJSONString(retVal));
// Long endtime = System.currentTimeMillis();
// Console.log("执行耗时为{}:" ,endtime-startTime + "ms");
//
// return retVal;
// } // }
ve = ValidationError.builder().field(fieldString).msg(one.getDefaultMessage()).build();
listVe.add(ve);
}
retVal = ResultUtil.error(listVe);
}else {
retVal = joinPoint.proceed(joinPoint.getArgs());
}
Console.log("返回内容 {}: " ,JSONObject.toJSONString(retVal));
Long endtime = System.currentTimeMillis();
Console.log("执行耗时为{}:" ,endtime-startTime + "ms");
return retVal;
}
protected void handleDataScope(final JoinPoint joinPoint) protected void handleDataScope(final JoinPoint joinPoint)
{ {
......
...@@ -28,8 +28,8 @@ public interface YgEnumInterface { ...@@ -28,8 +28,8 @@ public interface YgEnumInterface {
* 男女 * 男女
*/ */
@Getter @Getter
enum sex implements YgEnumInterface{ enum sex implements YgEnumInterface {
MAN(0,"男"),WOMAN(1,"女"); MAN(0, "男"), WOMAN(1, "女");
private Integer type; private Integer type;
...@@ -39,18 +39,21 @@ public interface YgEnumInterface { ...@@ -39,18 +39,21 @@ public interface YgEnumInterface {
this.type = type; this.type = type;
this.name = name; this.name = name;
} }
public static String isMan(String index) { public static String isMan(String index) {
sex mow = (index == null || index.length() == 0) ? sex.MAN : (index.indexOf(sex.MAN.name)!= -1)||(index.indexOf(sex.MAN.type)!= -1) ? sex.MAN:sex.WOMAN; sex mow = (index == null || index.length() == 0) ? sex.MAN
: (index.indexOf(sex.MAN.name) != -1) || (index.indexOf(sex.MAN.type) != -1) ? sex.MAN : sex.WOMAN;
return mow.type.toString(); return mow.type.toString();
} }
} }
/** /**
* 员工类型 * 员工类型
*/ */
@Getter @Getter
enum YgJobType implements YgEnumInterface{ enum YgJobType implements YgEnumInterface {
QUANZHI(0, "全"),SHIXI(1, "实习"),JIANZHI(2, "兼"),LWPQ(3, "劳务派遣"), QUANZHI(0, "全"), SHIXI(1, "实习"), JIANZHI(2, "兼"), LWPQ(3, "劳务派遣"), LAOWU(4, "劳务"), PAIQIAN(5, "派遣"),
LAOWU(4, "劳务"),PAIQIAN(5, "派遣"),WAIBAO(6, "外包"),TUIXIU(7, "退休"); WAIBAO(6, "外包"), TUIXIU(7, "退休");
private Integer type; private Integer type;
...@@ -63,9 +66,11 @@ public interface YgEnumInterface { ...@@ -63,9 +66,11 @@ public interface YgEnumInterface {
public static String choose(String index) { public static String choose(String index) {
YgJobType result = YgJobType.QUANZHI; YgJobType result = YgJobType.QUANZHI;
if(index == null || index.length() == 0) return result.type.toString(); if (index == null || index.length() == 0)
return result.type.toString();
for (YgJobType item : YgJobType.values()) { for (YgJobType item : YgJobType.values()) {
if (index.indexOf(item.getType()) !=-1 ||index.indexOf(item.getName()) !=-1 ) result = item; if (index.indexOf(item.getType()) != -1 || index.indexOf(item.getName()) != -1)
result = item;
} }
return result.type.toString(); return result.type.toString();
} }
...@@ -75,8 +80,8 @@ public interface YgEnumInterface { ...@@ -75,8 +80,8 @@ public interface YgEnumInterface {
* 员工状态 * 员工状态
*/ */
@Getter @Getter
enum jobStatus implements YgEnumInterface{ enum jobStatus implements YgEnumInterface {
SHIYONG(0,"试用"),ZHENSHI(1,"正式"),LIZHIZHONG(2,"离职中"),YILIZHI(3,"已离职"); SHIYONG(0, "试用"), ZHENSHI(1, "正式"), LIZHIZHONG(2, "离职中"), YILIZHI(3, "已离职");
private Integer type; private Integer type;
...@@ -86,21 +91,23 @@ public interface YgEnumInterface { ...@@ -86,21 +91,23 @@ public interface YgEnumInterface {
this.type = type; this.type = type;
this.name = name; this.name = name;
} }
public static String isZhen(String index) { public static String isZhen(String index) {
jobStatus zos = (index == null || index.length() == 0) ? YgEnumInterface.jobStatus.ZHENSHI: (index.indexOf(jobStatus.ZHENSHI.name)!= -1)||(index.indexOf(jobStatus.ZHENSHI.type)!= -1) ? jobStatus.ZHENSHI:jobStatus.SHIYONG; jobStatus zos = (index == null || index.length() == 0) ? YgEnumInterface.jobStatus.ZHENSHI
: (index.indexOf(jobStatus.ZHENSHI.name) != -1) || (index.indexOf(jobStatus.ZHENSHI.type) != -1)
? jobStatus.ZHENSHI
: jobStatus.SHIYONG;
return zos.type.toString(); return zos.type.toString();
} }
} }
/** /**
* 入职日期 * 入职日期
*/ */
@Getter @Getter
enum rzTime implements YgEnumInterface{ enum rzTime implements YgEnumInterface {
ZHEN("--","yyyy-M-d"),XIE("//","yyyy/M/d"), ZHEN("--", "yyyy-M-d"), XIE("//", "yyyy/M/d"), DIAN("..", "yyyy.M.d"), NYR("年月日", "yyyy年M月d日");
DIAN("..","yyyy.M.d"),NYR("年月日","yyyy年M月d日");
private String type; private String type;
...@@ -112,7 +119,7 @@ public interface YgEnumInterface { ...@@ -112,7 +119,7 @@ public interface YgEnumInterface {
} }
public static String tranTime(String index) { public static String tranTime(String index) {
//String str ="2013/11/12"; // String str ="2013/11/12";
if (index == null) { if (index == null) {
return null; return null;
} }
...@@ -124,42 +131,51 @@ public interface YgEnumInterface { ...@@ -124,42 +131,51 @@ public interface YgEnumInterface {
return result2; return result2;
} }
// public static String tranTime(String index) {
/* // DateFormat zhenFormat = new SimpleDateFormat(ZHEN.name);
* public static String tranTime(String index) { DateFormat zhenFormat = new // String result = zhenFormat.format(new Date());
* SimpleDateFormat(ZHEN.name); String result = zhenFormat.format(new Date()); // if (index == null || index.length() == 0)
* if (index == null || index.length() == 0) return result; Pattern pattern = // return result;
* Pattern.compile("^[0-9]{8}$"); if (pattern.matcher(index).matches()) { result // Pattern pattern = Pattern.compile("^[0-9]{8}$");
* = index.substring(0, 4) + "-" + index.substring(4, 6) + "-" + // if (pattern.matcher(index).matches()) {
* index.substring(6, 8); return result; } String s = // result = index.substring(0, 4) + "-" + index.substring(4, 6) + "-" + index.substring(6, 8);
* index.replaceAll("([1-9]+[0-9]*|0)(\\.[\\d]+)?", ""); for (rzTime item : // return result;
* rzTime.values()) { if (s.indexOf(item.type) != -1) { DateFormat dateFormat = // }
* new SimpleDateFormat(item.name); try { result = new // String s = index.replaceAll("([1-9]+[0-9]*|0)(\\.[\\d]+)?", "");
* SimpleDateFormat(ZHEN.name).format(dateFormat.parse(index)); return result; } // for (rzTime item : rzTime.values()) {
* catch (ParseException e) { e.printStackTrace(); return result; } } } return // if (s.indexOf(item.type) != -1) {
* result; } // DateFormat dateFormat = new SimpleDateFormat(item.name);
*/ // try {
// result = new SimpleDateFormat(ZHEN.name).format(dateFormat.parse(index));
// return result;
// } catch (ParseException e) {
// e.printStackTrace();
// return result;
// }
// }
// }
// return result;
// }
public static String tranTime2(String result) { public static String tranTime2(String result) {
String isYear ="^(?:(?!0000)[0-9]{4} -(?:(?:0[1-9]|1[0-2]) -(?:0[1-9]|1[0-9]|2[0-8]) |(?:0[13-9]|1[0-2]) -(?:29|30) |(?:0[13578]|1[02]) -31 )|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00) -02 -29 )$"; String isYear = "^(?:(?!0000)[0-9]{4} -(?:(?:0[1-9]|1[0-2]) -(?:0[1-9]|1[0-9]|2[0-8]) |(?:0[13-9]|1[0-2]) -(?:29|30) |(?:0[13578]|1[02]) -31 )|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00) -02 -29 )$";
Pattern pattern = Pattern.compile(isYear); Pattern pattern = Pattern.compile(isYear);
if (pattern.matcher(result).matches()) { if (pattern.matcher(result).matches()) {
return result; return result;
}else { } else {
result = new SimpleDateFormat(ZHEN.name).format(new Date()); result = new SimpleDateFormat(ZHEN.name).format(new Date());
return result; return result;
} }
} }
} }
/** /**
* 试用期 * 试用期
*/ */
@Getter @Getter
enum syq implements YgEnumInterface{ enum syq implements YgEnumInterface {
ZERO(0,"无"),ONE(1,"一"),TWO(2,"二"),THREE(3,"三"),FOUR(4,"四"),FIVE(5,"五"),SIX(6,"六"); ZERO(0, "无"), ONE(1, "一"), TWO(2, "二"), THREE(3, "三"), FOUR(4, "四"), FIVE(5, "五"), SIX(6, "六");
private Integer type; private Integer type;
...@@ -169,11 +185,14 @@ public interface YgEnumInterface { ...@@ -169,11 +185,14 @@ public interface YgEnumInterface {
this.type = type; this.type = type;
this.name = name; this.name = name;
} }
public static String choose(String index) { public static String choose(String index) {
syq result = syq.ZERO; syq result = syq.ZERO;
if (index == null || index.length() == 0) result.type.toString(); if (index == null || index.length() == 0)
result.type.toString();
for (syq item : syq.values()) { for (syq item : syq.values()) {
if (index.indexOf(item.getName()) !=-1 ||index.indexOf(item.getType()) !=-1 ) result=item; if (index.indexOf(item.getName()) != -1 || index.indexOf(item.getType()) != -1)
result = item;
} }
return result.type.toString(); return result.type.toString();
} }
...@@ -183,51 +202,66 @@ public interface YgEnumInterface { ...@@ -183,51 +202,66 @@ public interface YgEnumInterface {
* 工龄 * 工龄
*/ */
@Getter @Getter
enum workage implements YgEnumInterface{ enum workage implements YgEnumInterface {
//NEW(0,183),HALF(1,365),ONE(2,548),ONEHALF(3,730),TWO(4,913),LONG(5,10000); // NEW(0,183),HALF(1,365),ONE(2,548),ONEHALF(3,730),TWO(4,913),LONG(5,10000);
NEW(0,30,0),ROOKIE(31,183,0),HALF(184,365,0),ONE(366,548,0),ONEHALF(549,730,0),TWO(731,1000,0),LONG(1001,10000,0); NEW(0, 30, 0), ROOKIE(31, 183, 0), HALF(184, 365, 0), ONE(366, 548, 0), ONEHALF(549, 730, 0), TWO(731, 1000, 0),
LONG(1001, 10000, 0);
private Integer begin; private Integer begin;
private Integer end; private Integer end;
private Integer number; private Integer number;
workage(Integer begin, Integer end,Integer number) {
workage(Integer begin, Integer end, Integer number) {
this.begin = begin; this.begin = begin;
this.end = end; this.end = end;
this.number = number; this.number = number;
} }
public static Map<String, Integer> choose(List<YgbintuDto> bintu) { public static Map<String, Integer> choose(List<YgbintuDto> bintu) {
for (YgbintuDto b : bintu) { for (YgbintuDto b : bintu) {
Integer index = b.getWorkage(); Integer index = b.getWorkage();
for (workage item : workage.values()) { for (workage item : workage.values()) {
if (index>= item.begin && index<=item.end) item.number++; if (index >= item.begin && index <= item.end)
item.number++;
} }
} }
Map<String, Integer> result = new HashMap<String, Integer>(); Map<String, Integer> result = new HashMap<String, Integer>();
result.put("本月新入职", NEW.number); result.put("本月新入职", NEW.number);
result.put("x<0.5", NEW.number+ROOKIE.number); result.put("x<0.5", NEW.number + ROOKIE.number);
result.put("0.5<x<1", HALF.number); result.put("0.5<x<1", HALF.number);
result.put("1<x<1.5", ONE.number); result.put("1<x<1.5", ONE.number);
result.put("1.5<x<2", ONEHALF.number); result.put("1.5<x<2", ONEHALF.number);
result.put("2<x<3", TWO.number); result.put("2<x<3", TWO.number);
result.put("x++", LONG.number); result.put("x++", LONG.number);
NEW.number=0;ROOKIE.number=0;HALF.number=0;ONE.number=0;ONEHALF.number=0;TWO.number=0;LONG.number=0; NEW.number = 0;
ROOKIE.number = 0;
HALF.number = 0;
ONE.number = 0;
ONEHALF.number = 0;
TWO.number = 0;
LONG.number = 0;
return result; return result;
} }
} }
/** /**
* 年龄 * 年龄
*/ */
@Getter @Getter
enum age implements YgEnumInterface{ enum age implements YgEnumInterface {
//NEW(0,183),HALF(1,365),ONE(2,548),ONEHALF(3,730),TWO(4,913),LONG(5,10000); // NEW(0,183),HALF(1,365),ONE(2,548),ONEHALF(3,730),TWO(4,913),LONG(5,10000);
CHILD(1,17,0),TEEN(18,25,0),YOUNG(26,32,0),MAN(33,38,0),MIDDLE(39,45,0),OLD(46,1000,0); CHILD(1, 17, 0), TEEN(18, 25, 0), YOUNG(26, 32, 0), MAN(33, 38, 0), MIDDLE(39, 45, 0), OLD(46, 1000, 0);
private Integer begin; private Integer begin;
private Integer end; private Integer end;
private Integer number; private Integer number;
age(Integer begin, Integer end,Integer number) {
age(Integer begin, Integer end, Integer number) {
this.begin = begin; this.begin = begin;
this.end = end; this.end = end;
this.number = number; this.number = number;
} }
public static Map<String, Integer> choose(List<YgbintuDto> bintu) { public static Map<String, Integer> choose(List<YgbintuDto> bintu) {
Integer average = 0; Integer average = 0;
Integer i = 0; Integer i = 0;
...@@ -235,7 +269,9 @@ public interface YgEnumInterface { ...@@ -235,7 +269,9 @@ public interface YgEnumInterface {
for (YgbintuDto b : bintu) { for (YgbintuDto b : bintu) {
Integer index = b.getAge(); Integer index = b.getAge();
for (; i < age.values().length; i++) { for (; i < age.values().length; i++) {
if (index>= age.values()[i].begin && index<=age.values()[i].end) age.values()[i].number++;j++; if (index >= age.values()[i].begin && index <= age.values()[i].end)
age.values()[i].number++;
j++;
} }
average = average + index; average = average + index;
} }
...@@ -246,9 +282,14 @@ public interface YgEnumInterface { ...@@ -246,9 +282,14 @@ public interface YgEnumInterface {
result.put("32-38", MAN.number); result.put("32-38", MAN.number);
result.put("38-45", MIDDLE.number); result.put("38-45", MIDDLE.number);
result.put("45以上", OLD.number); result.put("45以上", OLD.number);
Integer pInjun = j>0 ?(average/j) :0; Integer pInjun = j > 0 ? (average / j) : 0;
result.put("平均年龄", pInjun); result.put("平均年龄", pInjun);
CHILD.number =0;TEEN.number=0;YOUNG.number=0;MAN.number=0;MIDDLE.number=0;OLD.number=0; CHILD.number = 0;
TEEN.number = 0;
YOUNG.number = 0;
MAN.number = 0;
MIDDLE.number = 0;
OLD.number = 0;
return result; return result;
} }
} }
......
package cn.timer.api.config.exception; package cn.timer.api.config.exception;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.timer.api.aspect.lang.bean.ValidationError;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
...@@ -57,4 +65,31 @@ public class GlobalExceptionHandler { ...@@ -57,4 +65,31 @@ public class GlobalExceptionHandler {
} }
return ResultUtil.error(e.getCode(), e.getMessage()); return ResultUtil.error(e.getCode(), e.getMessage());
} }
/**
* 自定义验证异常
*/
@ExceptionHandler(MethodArgumentNotValidException.class)
public Object validExceptionHandler(MethodArgumentNotValidException e)
{
// log.error("1--------"+e.getMessage());
// log.error("2--------"+JSONUtil.parse(e.getBindingResult().getAllErrors()));
// String message = e.getBindingResult().getFieldError().getDefaultMessage();
// String field = e.getBindingResult().getFieldError().getField();
List<ObjectError> ls = e.getBindingResult().getAllErrors();
List<ValidationError> listVe = new ArrayList<ValidationError>();
ValidationError ve;
for (ObjectError one : ls) {
String fieldString = one.getCodes().length >= 1 ? one.getCodes()[0] : "";
if (fieldString != null) {
fieldString = fieldString.substring(fieldString.lastIndexOf(".") + 1);
}
ve = ValidationError.builder().field(fieldString).msg(one.getDefaultMessage()).build();
listVe.add(ve);
}
return ResultUtil.error(listVe);
}
} }
package cn.timer.api.config.exception;
public class ValidationMsg {
public static final String NULL = "参数必须为空";
public static final String NOTNULL = "参数值不能为空";
public static final String NOTEMPTY = "参数值不能为空";
public static final String NOTBLANK = "参数键值不能为空";
public static final String ASSERTTRUE = "参数值必须为true";
public static final String ASSERTFALSE = "参数值必须为false";
public static final String PATTERN = "参数值格式不符";
public static final String SIZE = "参数长度不符";
public static final String MIN = "参数值太小";
public static final String MAX = "参数值太大";
public static final String DECIMALMIN = "参数值太小";
public static final String DECIMALMAX = "参数值太大";
public static final String DIGITS = "参数值大小不在有效范围内";
public static final String PAST = "参数值必须为过去日期";
public static final String FUTURE = "参数值必须为未来日期";
public static final String EMAIL = "参数值格式必须为邮箱地址";
public static final String LENGTH = "参数值长度不在有效范围内";
public static final String RANGE = "参数值不在有效范围内";
}
...@@ -22,9 +22,10 @@ public class MyConfiguration { ...@@ -22,9 +22,10 @@ public class MyConfiguration {
// 创建配置类 // 创建配置类
FastJsonConfig config = new FastJsonConfig(); FastJsonConfig config = new FastJsonConfig();
config.setSerializerFeatures( config.setSerializerFeatures(
SerializerFeature.WriteNullListAsEmpty, SerializerFeature.PrettyFormat
SerializerFeature.WriteMapNullValue, // SerializerFeature.WriteNullListAsEmpty,
SerializerFeature.WriteNullStringAsEmpty // SerializerFeature.WriteMapNullValue,
// SerializerFeature.WriteNullStringAsEmpty
); );
//此处是全局处理方式 //此处是全局处理方式
......
...@@ -75,7 +75,7 @@ public class WebSecurityConfig implements WebMvcConfigurer { ...@@ -75,7 +75,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {
// 2.添加fastJson的配置信息,比如,是否需要格式化返回的json数据 // 2.添加fastJson的配置信息,比如,是否需要格式化返回的json数据
FastJsonConfig fastJsonConfig = new FastJsonConfig(); FastJsonConfig fastJsonConfig = new FastJsonConfig();
// 时间格式化 // 时间格式化
// fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss"); fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss");
// fastJsonConfig.setDateFormat("yyyy-MM-dd"); // fastJsonConfig.setDateFormat("yyyy-MM-dd");
// 空值特别处理 // 空值特别处理
// WriteNullListAsEmpty 将Collection类型字段的字段空值输出为[] // WriteNullListAsEmpty 将Collection类型字段的字段空值输出为[]
......
...@@ -9,6 +9,8 @@ import javax.validation.Valid; ...@@ -9,6 +9,8 @@ import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -167,7 +169,7 @@ public class SpmkController { ...@@ -167,7 +169,7 @@ public class SpmkController {
@PostMapping(value = "/save_approval_template") @PostMapping(value = "/save_approval_template")
@ApiOperation(value = "5.新增或编辑-审批模板", httpMethod = "POST", notes = "新增或编辑-审批模板") @ApiOperation(value = "5.新增或编辑-审批模板", httpMethod = "POST", notes = "新增或编辑-审批模板")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
public Result<Object> saveAt(@Valid @RequestBody SpmkApprovalTemplateDto spmkApprovalTemplateDto,BindingResult bindingResult){ public Result<Object> saveAt(@Validated @RequestBody SpmkApprovalTemplateDto spmkApprovalTemplateDto){
Integer approvalTemplateGId = spmkApprovalTemplateDto.getApprovalTemplateGId(); Integer approvalTemplateGId = spmkApprovalTemplateDto.getApprovalTemplateGId();
if (ObjectUtil.isNull(approvalTemplateGId)) if (ObjectUtil.isNull(approvalTemplateGId))
return ResultUtil.error("操作失败!-1"); return ResultUtil.error("操作失败!-1");
...@@ -415,8 +417,7 @@ public class SpmkController { ...@@ -415,8 +417,7 @@ public class SpmkController {
@ApiOperation(value = "17.发起审批", httpMethod = "POST", notes = "发起审批") @ApiOperation(value = "17.发起审批", httpMethod = "POST", notes = "发起审批")
@ApiOperationSupport(order = 17) @ApiOperationSupport(order = 17)
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
// @BindingResultCtrol(title = "发起审批") public Result<Object> saveCa(@CurrentUser UserBean userBean,@Validated @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto) throws Exception{
public Result<Object> saveCa(@CurrentUser UserBean userBean,@Valid @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto,BindingResult bindingResult) throws Exception{
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>() YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.lambda() .lambda()
.select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName) .select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName)
...@@ -545,7 +546,7 @@ public class SpmkController { ...@@ -545,7 +546,7 @@ public class SpmkController {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
// @BindingResultCtrol(title = "审批人审批") // @BindingResultCtrol(title = "审批人审批")
public Result<Object> approving(@Valid @RequestBody ApprovingDto approvingDto, BindingResult bindingResult) throws Exception { public Result<Object> approving(@Validated @RequestBody ApprovingDto approvingDto) throws Exception {
SpmkApproveDetail ad = SpmkApproveDetail.builder().build().selectOne(new QueryWrapper<SpmkApproveDetail>() SpmkApproveDetail ad = SpmkApproveDetail.builder().build().selectOne(new QueryWrapper<SpmkApproveDetail>()
.lambda() .lambda()
.select(SpmkApproveDetail::getId, .select(SpmkApproveDetail::getId,
...@@ -615,7 +616,7 @@ public class SpmkController { ...@@ -615,7 +616,7 @@ public class SpmkController {
@PostMapping(value = "/select_my_approve") @PostMapping(value = "/select_my_approve")
@ApiOperation(value = "21.查询列表-我审批的/抄送我的-分页", httpMethod = "POST", notes = "查询列表-我审批的-关键字、审批状态、发起时间-分页") @ApiOperation(value = "21.查询列表-我审批的/抄送我的-分页", httpMethod = "POST", notes = "查询列表-我审批的-关键字、审批状态、发起时间-分页")
@ApiOperationSupport(order = 21) @ApiOperationSupport(order = 21)
public Result<Object> selectMyAs(@CurrentUser UserBean userBean, @RequestBody MySummaryQueryDto mySummaryQueryDto) { public Result<Object> selectMyAs(@CurrentUser UserBean userBean, @Validated @RequestBody MySummaryQueryDto mySummaryQueryDto) throws MethodArgumentNotValidException{
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>( IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(
mySummaryQueryDto.getCurrentPage() == null ? 1 : mySummaryQueryDto.getCurrentPage(), mySummaryQueryDto.getCurrentPage() == null ? 1 : mySummaryQueryDto.getCurrentPage(),
mySummaryQueryDto.getTotalPage() == null ? 10 : mySummaryQueryDto.getTotalPage()); mySummaryQueryDto.getTotalPage() == null ? 10 : mySummaryQueryDto.getTotalPage());
...@@ -625,7 +626,6 @@ public class SpmkController { ...@@ -625,7 +626,6 @@ public class SpmkController {
IPage<SpmkApproveSummary> pageAs = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(page, mySummaryQueryDto); IPage<SpmkApproveSummary> pageAs = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(page, mySummaryQueryDto);
List<SpmkApproveSummary> listAs = pageAs.getRecords(); List<SpmkApproveSummary> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!"); return ResultUtil.data(pageAs, listAs, "操作成功!");
} }
......
...@@ -1548,7 +1548,7 @@ public class YgglController { ...@@ -1548,7 +1548,7 @@ public class YgglController {
updateWrapper.eq("emp_num", empNum); updateWrapper.eq("emp_num", empNum);
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>(); UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", empNum); updateWrapper1.eq("emp_num", empNum);
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(3).build().update(updateWrapper); YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).build().update(updateWrapper);
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime()) YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1); .lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
...@@ -1816,7 +1816,7 @@ public class YgglController { ...@@ -1816,7 +1816,7 @@ public class YgglController {
@ApiOperation(value = "查询员工列表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "查询员工列表", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 62) @ApiOperationSupport(order = 62)
public Result<List<YgQueryDto>> queryEmpMessage(@CurrentUser UserBean userBean) { public Result<List<YgQueryDto>> queryEmpMessage(@CurrentUser UserBean userBean) {
List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean); List<YgQueryDto> ygQueryDto = ygglMainEmpMapper.queryEmpMessage(userBean.getOrgCode());
for (YgQueryDto yg : ygQueryDto) { for (YgQueryDto yg : ygQueryDto) {
if (StringUtil.isEmpty(yg.getHeadUrl())) { if (StringUtil.isEmpty(yg.getHeadUrl())) {
yg.setHeadUrl(""); yg.setHeadUrl("");
......
...@@ -2,6 +2,7 @@ package cn.timer.api.dao.yggl; ...@@ -2,6 +2,7 @@ package cn.timer.api.dao.yggl;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -46,7 +47,7 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> { ...@@ -46,7 +47,7 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @param userBean * @param userBean
* @return * @return
*/ */
List<YgQueryDto> queryEmpMessage(UserBean userBean); List<YgQueryDto> queryEmpMessage(@Param("orgCode") Integer orgCode);
/** /**
......
...@@ -2,6 +2,7 @@ package cn.timer.api.dto.spmk; ...@@ -2,6 +2,7 @@ package cn.timer.api.dto.spmk;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -14,22 +15,22 @@ import lombok.NoArgsConstructor; ...@@ -14,22 +15,22 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class ApprovingDto { public class ApprovingDto {
@NotNull(message = "asId为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "审批汇总id", example = "2", required = true) @ApiModelProperty(value = "审批汇总id", example = "2", required = true)
private Integer asId; private Integer asId;
@NotNull(message = "executeRecordId为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "审批执行记录id", example = "10", required = true) @ApiModelProperty(value = "审批执行记录id", example = "10", required = true)
private Integer executeRecordId; private Integer executeRecordId;
@NotNull(message = "executorId为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "执行人记录id", example = "10", required = true) @ApiModelProperty(value = "执行人记录id", example = "10", required = true)
private Integer executorId; private Integer executorId;
@ApiModelProperty(value = "意见", example = "同意、拒绝") @ApiModelProperty(value = "意见", example = "同意、拒绝")
private String opinion; private String opinion;
@NotNull(message = "sts为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "状态 2同意 3拒绝 4转派", example = "2", required = true) @ApiModelProperty(value = "状态 2同意 3拒绝 4转派", example = "2", required = true)
private Integer sts; private Integer sts;
......
...@@ -2,9 +2,11 @@ package cn.timer.api.dto.spmk; ...@@ -2,9 +2,11 @@ package cn.timer.api.dto.spmk;
import javax.validation.constraints.DecimalMax; import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin; import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page; import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -34,9 +36,9 @@ public class MySummaryQueryDto extends Page{ ...@@ -34,9 +36,9 @@ public class MySummaryQueryDto extends Page{
@ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10") @ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10")
private String endTime; private String endTime;
@NotNull(message = "type为空") @NotNull(message = ValidationMsg.NOTNULL)
@DecimalMax(value = "2",message = "type 只能为 0我发起的 1抄送我的 2我审批的") @DecimalMax(value = "2",message = ValidationMsg.DECIMALMAX+" 只能为 0我发起的 1抄送我的 2我审批的")
@DecimalMin(value = "0",message = "type 只能为 0我发起的 1抄送我的 2我审批的") @DecimalMin(value = "0",message = ValidationMsg.DECIMALMIN+" 只能为 0我发起的 1抄送我的 2我审批的")
@ApiModelProperty(value = "0我发起的 1抄送我的 2我审批的", example = "0") @ApiModelProperty(value = "0我发起的 1抄送我的 2我审批的", example = "0")
private Integer type; private Integer type;
......
...@@ -11,6 +11,7 @@ import javax.validation.constraints.NotEmpty; ...@@ -11,6 +11,7 @@ import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -26,15 +27,15 @@ public class SpmkApprovalTemplateDto { ...@@ -26,15 +27,15 @@ public class SpmkApprovalTemplateDto {
@ApiModelProperty(value = "编号 编号", example = "101") @ApiModelProperty(value = "编号 编号", example = "101")
private Integer id; private Integer id;
@NotNull(message = "approvalTemplateGId为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "审批模板组id 当前用户ID", example = "101") @ApiModelProperty(value = "审批模板组id 当前用户ID", example = "101")
private Integer approvalTemplateGId; private Integer approvalTemplateGId;
@NotBlank(message = "iconUrl为空") @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "审批图标地址 ", example = "审批图标地址") @ApiModelProperty(value = "审批图标地址 ", example = "审批图标地址")
private String iconUrl; private String iconUrl;
@NotBlank(message = "name为空") @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "审批名称 ", example = "审批名称") @ApiModelProperty(value = "审批名称 ", example = "审批名称")
private String name; private String name;
...@@ -47,7 +48,7 @@ public class SpmkApprovalTemplateDto { ...@@ -47,7 +48,7 @@ public class SpmkApprovalTemplateDto {
@ApiModelProperty(value = "排序 由于区分关键字,命名后缀加s", example = "101") @ApiModelProperty(value = "排序 由于区分关键字,命名后缀加s", example = "101")
private Integer ranks; private Integer ranks;
@NotBlank(message = "isOpinion为空 是否必填 意见 0是 1否") @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "审批意见 是否必填 意见 0是 1否", example = "101") @ApiModelProperty(value = "审批意见 是否必填 意见 0是 1否", example = "101")
private Integer isOpinion; private Integer isOpinion;
...@@ -57,17 +58,17 @@ public class SpmkApprovalTemplateDto { ...@@ -57,17 +58,17 @@ public class SpmkApprovalTemplateDto {
@ApiModelProperty(value = "创建时间 ", example = "创建时间") @ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime; private Date createTime;
@NotNull(message = "assoType为空") @NotNull(message = ValidationMsg.NOTNULL)
@DecimalMax(value = "9",message = "assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ") @DecimalMax(value = "9",message = ValidationMsg.DECIMALMAX +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ")
@DecimalMin(value = "0",message = "assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ") @DecimalMin(value = "0",message = ValidationMsg.DECIMALMIN +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ")
@ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪", example = "1") @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4加班 5请假 6出差 7外出 8补卡 9调薪", example = "1")
private Integer assoType; private Integer assoType;
@NotEmpty(message = "froms为空") @NotEmpty(message = ValidationMsg.NOTEMPTY)
@ApiModelProperty(value = "审批表单 ", example = "审批表单") @ApiModelProperty(value = "审批表单 ", example = "审批表单")
private List<JSONObject> froms; private List<JSONObject> froms;
@NotNull(message = "router为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "审批流程 ", example = "审批流程") @ApiModelProperty(value = "审批流程 ", example = "审批流程")
private Router router; private Router router;
......
...@@ -8,6 +8,7 @@ import javax.validation.constraints.NotBlank; ...@@ -8,6 +8,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -23,36 +24,36 @@ import lombok.NoArgsConstructor; ...@@ -23,36 +24,36 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class SpmkApproveSummaryDto{ public class SpmkApproveSummaryDto{
@NotBlank(message = "title为空") @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "标题 ", example = "标题", required = true) @ApiModelProperty(value = "标题 ", example = "标题", required = true)
private String title; private String title;
@NotBlank(message = "approveName为空") @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "审批名称 ", example = "审批名称", required = true) @ApiModelProperty(value = "审批名称 ", example = "审批名称", required = true)
private String approveName; private String approveName;
@ApiModelProperty(value = "摘要", example = "摘要", required = true) @ApiModelProperty(value = "摘要", example = "摘要", required = true)
private String digest; private String digest;
@NotBlank(message = "initiator为空") @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "发起人名称 ", example = "发起人名称", required = true) @ApiModelProperty(value = "发起人名称 ", example = "发起人名称", required = true)
private String initiator; private String initiator;
@NotNull(message = "assoType为空") @NotNull(message = ValidationMsg.NOTNULL)
@DecimalMax(value = "9",message = "assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ") @DecimalMax(value = "9",message = ValidationMsg.DECIMALMAX +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ")
@DecimalMin(value = "0",message = "assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ") @DecimalMin(value = "0",message = ValidationMsg.DECIMALMIN +" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 ")
@ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡", example = "1") @ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡", example = "1")
private Integer assoType; private Integer assoType;
@NotNull(message = "requestData为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "申请数据 ", example = "申请数据", required = true) @ApiModelProperty(value = "申请数据 ", example = "申请数据", required = true)
private JSONObject requestData; private JSONObject requestData;
@NotNull(message = "froms为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "审批表单 ", example = "数组", required = true) @ApiModelProperty(value = "审批表单 ", example = "数组", required = true)
private List<JSONObject> froms; private List<JSONObject> froms;
@NotNull(message = "router为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "审批流程", example = "审批流程", required = true) @ApiModelProperty(value = "审批流程", example = "审批流程", required = true)
private Router router; private Router router;
......
...@@ -107,9 +107,9 @@ ...@@ -107,9 +107,9 @@
WHERE a.org_code = #{param.orgCode} WHERE a.org_code = #{param.orgCode}
<if test="param.query != null and param.query != ''"> <if test="param.query != null and param.query != ''">
and ( and (
a.title like CONCAT(#{param.query},'%') or a.title like CONCAT('%',#{param.query},'%') or
a.initiator like CONCAT(#{param.query},'%') or a.initiator like CONCAT('%',#{param.query},'%') or
a.id like CONCAT(#{param.query},'%') a.id like CONCAT('%',#{param.query},'%')
) )
</if> </if>
<if test="param.sts != null"> <if test="param.sts != null">
...@@ -159,9 +159,9 @@ ...@@ -159,9 +159,9 @@
</if> </if>
<if test="param.query != null and param.query != ''"> <if test="param.query != null and param.query != ''">
and ( and (
a.title like CONCAT(#{param.query},'%') or a.title like CONCAT('%',#{param.query},'%') or
a.initiator like CONCAT(#{param.query},'%') or a.initiator like CONCAT('%',#{param.query},'%') or
a.id like CONCAT(#{param.query},'%') a.id like CONCAT('%',#{param.query},'%')
) )
</if> </if>
<if test="param.startTime != null and param.startTime != ''"> <if test="param.startTime != null and param.startTime != ''">
......
...@@ -193,9 +193,9 @@ ...@@ -193,9 +193,9 @@
<!-- 查询员工信息 搜索 分页 --> <!-- 查询员工信息 搜索 分页 -->
<select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto"> <select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto">
SELECT SELECT
a. NAME empName, a.name empName,
a.emp_num empNum, a.emp_num empNum,
b. NAME deptName, b.name deptName,
a.rz_time rzTime, a.rz_time rzTime,
a.job_type jobType, a.job_type jobType,
a.phone phone, a.phone phone,
......
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