2022-03-11 16:19:47 +08:00
|
|
|
package com.engine.salary.entity.datacollection.param;
|
|
|
|
|
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.Builder;
|
|
|
|
|
import lombok.Data;
|
|
|
|
|
import lombok.NoArgsConstructor;
|
2022-03-15 09:55:58 +08:00
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2022-03-11 16:19:47 +08:00
|
|
|
|
|
|
|
|
import java.util.Collection;
|
2022-03-15 09:55:58 +08:00
|
|
|
import java.util.stream.Collectors;
|
2022-03-11 16:19:47 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 数据采集-考勤引用字段
|
|
|
|
|
* @Author: wangxiangzhong
|
|
|
|
|
* @Date: 2021-11-17 14:37
|
|
|
|
|
*/
|
|
|
|
|
@Data
|
|
|
|
|
@Builder
|
|
|
|
|
@NoArgsConstructor
|
|
|
|
|
@AllArgsConstructor
|
|
|
|
|
//数据采集-考勤引用字段查询参数")
|
2022-03-15 09:55:58 +08:00
|
|
|
public class AttendQuoteFieldQueryParam {
|
2022-03-11 16:19:47 +08:00
|
|
|
|
|
|
|
|
private Collection<Long> ids;
|
|
|
|
|
|
|
|
|
|
private Long id;
|
|
|
|
|
|
2022-03-15 09:55:58 +08:00
|
|
|
//字段名称
|
2022-03-11 16:19:47 +08:00
|
|
|
private String fieldName;
|
2022-03-15 09:55:58 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询where语句
|
|
|
|
|
* @param queryParam
|
|
|
|
|
*/
|
|
|
|
|
public static String genWhereSql(AttendQuoteFieldQueryParam queryParam) {
|
|
|
|
|
String whereSQl = "t1.delete_type = 0 ";
|
|
|
|
|
Collection<Long> ids = queryParam.getIds();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(ids)) {
|
|
|
|
|
String idsStr = ids.stream().map(String::valueOf).collect(Collectors.joining(","));
|
|
|
|
|
whereSQl += " AND t1.id IN (" + idsStr + ")";
|
|
|
|
|
}
|
|
|
|
|
String fieldName = queryParam.getFieldName();
|
|
|
|
|
if (StringUtils.isNotBlank(fieldName)) {
|
|
|
|
|
whereSQl += " AND t1.field_name like '%" + fieldName + "%'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return whereSQl;
|
|
|
|
|
}
|
2022-03-11 16:19:47 +08:00
|
|
|
}
|