Commit 5234de95 by xmh

1

0 parents
Showing 165 changed files with 4824 additions and 0 deletions
**/**/logs/
**/**/target/
*.iml
**/**/.idea/
.mvn
mvnw*
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.viontech</groupId>
<artifactId>label</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>label-core</artifactId>
<version>${project.parent.version}</version>
<dependencies>
<dependency>
<groupId>com.viontech.keliu</groupId>
<artifactId>keliu-util</artifactId>
<version>6.0.10-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file \ No newline at end of file
package com.viontech.label.core.base;
import java.io.Serializable;
/**
*
* @author suman
* model类的基类 所有的model都要继承自该类
*/
public abstract class BaseModel implements Serializable{
private Long count;
private Long id;
public BaseModel() {
super();
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
package com.viontech.label.core.base;
import java.io.IOException;
/**
* .
*
* @author 谢明辉
* @date 2021/5/31
*/
public interface BaseStorage {
byte[] get(String path) throws IOException;
void set(String path, byte[] data)throws IOException;
boolean delete(String path)throws IOException;
}
package com.viontech.label.core.base;
import org.springframework.core.convert.converter.Converter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author xmh
* @date 2021-06-17
*/
public class DateConverter implements Converter<String, Date> {
/**
* 可格式化 的日期 字串
*/
private static final List<String> formarts = new ArrayList<>();
static {
formarts.add("yyyy-MM");
formarts.add("yyyy-MM-dd");
formarts.add("yyyy-MM-dd HH:mm");
formarts.add("yyyy-MM-dd HH:mm:ss");
formarts.add("HH:mm:ss");
formarts.add("HH:mm");
formarts.add("yyyy-MM-dd'T'HH:mm:ss");
}
@Override
public Date convert(String source) {
String value = source.trim();
if ("".equals(value)) {
return null;
}
if (source.matches("^\\d{4}-\\d{1,2}$")) {
return parseDate(source, formarts.get(0));
} else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")) {
return parseDate(source, formarts.get(1));
} else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}$")) {
return parseDate(source, formarts.get(2));
} else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")) {
return parseDate(source, formarts.get(3));
} else if (source.matches("([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]")) {
return parseDate(source, formarts.get(4));
} else if (source.matches("([01][0-9]|2[0-3]):[0-5][0-9]")) {
return parseDate(source, formarts.get(5));
} else if (source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}T\\d{1,2}:\\d{1,2}:\\d{1,2}[-,+]\\d{1,2}:\\d{1,2}$")) {
return parseDate(source, formarts.get(6));
} else {
throw new IllegalArgumentException("Invalid boolean value '" + source + "'");
}
}
/**
* 功能描述:格式化日期
*
* @param dateStr String 字符型日期
* @param format String 格式
*
* @return Date 日期
*/
public Date parseDate(String dateStr, String format) {
Date date = null;
try {
DateFormat dateFormat = new SimpleDateFormat(format);
date = (Date) dateFormat.parse(dateStr);
} catch (Exception e) {
}
return date;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.core.base;
import java.lang.annotation.*;
/**
* .
*
* @author 谢明辉
* @date 2021/5/26
*/
@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@SuppressWarnings("ALL")
public @interface RedisCache {
String key() default "";
long expired() default -1L;
MethodType methodType() default MethodType.GET;
public static enum MethodType {
GET,
ADD,
UPDATE,
DELETE;
}
}
package com.viontech.label.core.constant;
/**
* .
*
* @author 谢明辉
* @date 2021/5/26
*/
public class Constants {
public static final String REDIS_KEY_USER_MAP = "userMap";
public static final String REDIS_KEY_STORAGE_MAP = "storageMap";
public static final String REDIS_KEY_PACK_MAP = "packMap";
public static final String REDIS_KEY_DATASOURCE = "datasourceMap";
public static final Integer USER_TYPE_ANNOTATOR = 5;
public static final Integer USER_TYPE_OUT_INSPECTOR = 4;
public static final Integer USER_TYPE_IN_INSPECTOR = 3;
private static final String REDIS_KEY_PIC_PREFIX = "pic";
public static String getRedisKeyPic(Long picId) {
return REDIS_KEY_PIC_PREFIX + ":" + picId;
}
public static String getReidPoolName(Long packId) {
return "reid_pool_" + packId;
}
}
package com.viontech.label.core.constant;
/**
* .
*
* @author 谢明辉
* @date 2021/6/24
*/
public enum LogOperateType {
/** 合并图片作为新人 */
REID_MERGE_AS_NEW_PERSON(1),
/** 合并多个人作为同一个人 */
REID_MERGE_PERSON(2),
/** 将图片与人合并 */
REID_MERGE_TO(3),
/** 删除图片 */
REID_DELETE(4),
/** 标记为纯净 */
REID_LABEL_FINISHED(5),
;
public int val;
LogOperateType(int val) {
this.val = val;
}
}
package com.viontech.label.core.constant;
/**
* .
*
* @author 谢明辉
* @date 2021/6/23
*/
public enum PicStatus {
/** 待标注 */
TO_BE_LABELED(1),
/** 标注中 */
LABELING(2),
/** 完成标注 */
FINISH_LABELING(3),
;
public int val;
PicStatus(int val) {
this.val = val;
}
}
package com.viontech.label.core.model;
import com.viontech.label.core.base.BaseStorage;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
/**
* .
*
* @author 谢明辉
* @date 2021/5/31
*/
public class LocalStorage implements BaseStorage {
private final String basePath;
public LocalStorage(String basePath) {
this.basePath = basePath;
}
@Override
public byte[] get(String path) throws IOException {
return FileUtils.readFileToByteArray(new File(basePath, path));
}
@Override
public void set(String path, byte[] data) throws IOException {
FileUtils.writeByteArrayToFile(new File(basePath, path), data);
}
@Override
public boolean delete(String path) throws IOException {
return FileUtils.deleteQuietly(new File(basePath, path));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.viontech</groupId>
<artifactId>label</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>label-platform</artifactId>
<version>${project.parent.version}</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.viontech</groupId>
<artifactId>label-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.4</version>
<exclusions>
<exclusion>
<artifactId>mybatis</artifactId>
<groupId>org.mybatis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
<exclusions>
<exclusion>
<artifactId>mybatis-spring-boot-starter</artifactId>
<groupId>org.mybatis.spring.boot</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.19.0</version>
</dependency>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis-jackson</artifactId>
<version>1.19.0</version>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.11.2</version>
</dependency>
<dependency>
<groupId>de.ruedigermoeller</groupId>
<artifactId>fst</artifactId>
<version>2.57</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.7.Final</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.viontech.keliu</groupId>
<artifactId>AlgApiClient</artifactId>
<version>6.0.6-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>tomcat-websocket</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
</dependencies>
<build>
<finalName>label-platform</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>application-*.properties</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.yml</include>
<include>**/*.html</include>
<include>**/*.jpg</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
/**
* @author 谢明辉
*/
@SpringBootApplication
@MapperScan(basePackages = "com.viontech.label.platform.mapper")
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableScheduling
public class LabelPlatformApp {
public static void main(String[] args) {
SpringApplication.run(LabelPlatformApp.class, args);
}
}
package com.viontech.label.platform.aop;
import com.viontech.label.core.constant.Constants;
import com.viontech.label.core.base.RedisCache;
import com.viontech.label.platform.service.impl.PackServiceImpl;
import com.viontech.label.platform.service.impl.StorageServiceImpl;
import com.viontech.label.platform.service.impl.UserServiceImpl;
import com.viontech.label.platform.utils.StorageUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* .
*
* @author 谢明辉
* @date 2021/5/26
*/
@Component
@Aspect
public class CacheAspect {
@Resource
private RedisTemplate redisTemplate;
@Resource
private StorageUtils storageUtils;
@After("@annotation(redisCache)")
public void after(JoinPoint point, RedisCache redisCache) {
Object aThis = point.getThis();
Object target = point.getTarget();
RedisCache.MethodType methodType = redisCache.methodType();
Object[] args = point.getArgs();
String redisKey = null;
if (aThis instanceof UserServiceImpl) {
redisKey = Constants.REDIS_KEY_USER_MAP;
} else if (aThis instanceof PackServiceImpl && !methodType.equals(RedisCache.MethodType.GET)) {
storageUtils.refreshPack();
} else if (aThis instanceof StorageServiceImpl && !methodType.equals(RedisCache.MethodType.GET)) {
storageUtils.refreshStorage();
}
if (!methodType.equals(RedisCache.MethodType.GET) && redisKey != null) {
redisTemplate.delete(redisKey);
}
}
}
package com.viontech.label.platform.base;
import com.github.pagehelper.PageInfo;
import com.viontech.keliu.util.FileUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import static com.viontech.keliu.util.JsonMessageUtil.getErrorJsonMsg;
import static com.viontech.keliu.util.JsonMessageUtil.getSuccessJsonMsg;
/**
* Controller基类<br>
* 所有Controller都需要继承自该类
*
* @param <T>
*
* @author suman 2016年8月15日 下午1:59:19
*/
public abstract class BaseController<O extends BaseModel, T extends VoInterface<O>> {
/**
* 通用message
*/
public static final String MESSAGE_ADD_SUCCESS = "addSuccess";
public static final String MESSAGE_ADD_ERROR = "addError";
public static final String MESSAGE_UPDATE_SUCCESS = "updateSuccess";
public static final String MESSAGE_UPDATE_ERROR = "updateError";
public static final String MESSAGE_DELETE_SUCCESS = "delSuccess";
public static final String MESSAGE_DELETE_ERROR = "delError";
public static final String MESSAGE_COUNT_SUCCESS = "countSuccess";
public static final String MESSAGE_COUNT_ERROR = "countError";
public static final String MESSAGE_SELECT_SUCCESS = "selSuccess";
public static final String MESSAGE_SELECT_ERROR = "selError";
public static final String MESSAGE_LIST_SUCCESS = "listSuccess";
public static final String MESSAGE_LIST_ERROR = "listError";
public static final String MESSAGE_PAGE_SUCCESS = "pageSuccess";
public static final String MESSAGE_PAGE_ERROR = "pageError";
public static final String MESSAGE_WEBROOT_NOTFOUND_ERROR = "webRootNotFoundError";
public static final String MESSAGE_FILE_UPLOAD_SUCCESS = "fileUploadSuccess";
public static final String MESSAGE_FILE_UPLOAD_ERROR = "fileUploadError";
public static final String MESSAGE_FILE_DOWNLOAD_ERROR = "fileDownloadError";
public static final String MESSAGE_FILE_NOTFOUND_ERROR = "fileNotFoundError";
public static final String MESSAGE_ID_NOT_EMPTY = "idNotEmpty";
public static final String MESSAGE_MODE_NOT_EXISTENCE = "modleNotExistence";
public static final int EXAMPLE_TYPE_SIMPLE = 0;
public static final int EXAMPLE_TYPE_NORMAL = 1;
public static final int EXAMPLE_TYPE_COUNT = 3;
public static final int EXAMPLE_TYPE_PAGE = 4;
/**
* slf4j 日志对象 用来记录log
*/
protected final Logger logger = LoggerFactory.getLogger(getClass());
/*@InitBinder
public void initBinder(WebDataBinder binder) {
binder.registerCustomEditor(Date.class, new CustomDateEditor(true,
"yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd", "yyyy-MM", "HH:mm:ss"));
}*/
public static boolean isNotNull(Object object) {
if (object == null) {
return false;
}
if (object.toString().trim().isEmpty()) {
return false;
}
return true;
}
/**
* 通用添加方法
*
* @param t 需要插入数据库的对象
*
* @return
*/
@RequestMapping(value = "", method = RequestMethod.POST)
@ResponseBody
public Object add(@RequestBody T t) {
getService().insertSelective(t.getModel());
return getSuccessJsonMsg(MESSAGE_ADD_SUCCESS, t);
}
/**
* 通用数量方法
*
* @param t 需要插入数据库的对象的条件
*
* @return
*/
@RequestMapping(value = "/count", method = RequestMethod.GET)
@ResponseBody
public Object count(T t) {
int result = getService().countByExample(getExample(t, EXAMPLE_TYPE_COUNT));
return getSuccessJsonMsg(MESSAGE_COUNT_SUCCESS, result);
}
/**
* 通用更新方法
*
* @param t 需要更新的对象及内容
*
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable(value = "id") Long id, @RequestBody T t) {
t.getModel().setId(id);
getService().updateByPrimaryKeySelective(t.getModel());
return getSuccessJsonMsg(MESSAGE_UPDATE_SUCCESS, t);
}
/**
* 通用删除方法
*
* @param id 需要删除的数据id
*
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseBody
public Object del(@PathVariable(value = "id") Long id) {
if (id == null) {
return getErrorJsonMsg(MESSAGE_ID_NOT_EMPTY);
}
int result = getService().deleteByPrimaryKey(id);
if (result == 0) {
return getErrorJsonMsg(MESSAGE_MODE_NOT_EXISTENCE);
}
return getSuccessJsonMsg(MESSAGE_DELETE_SUCCESS, null);
}
/**
* 通用列表查询方法,将数据从数据库中全部查出
* saveFile
*
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object selOne(@PathVariable(value = "id") Long id) {
BaseModel t = getService().selectByPrimaryKey(id);
return getSuccessJsonMsg(MESSAGE_LIST_SUCCESS, t);
}
/**
* 通用分页查询方法,从数据库中查出一页数据
*
* @return
*/
@RequestMapping(value = "", method = RequestMethod.GET)
@ResponseBody
public Object page(T t, @RequestParam(value = "page", defaultValue = "-1") int page, @RequestParam(value = "pageSize", defaultValue = "100") int pageSize, String sortName, String sortOrder) {
BaseExample baseExample = getExample(t, EXAMPLE_TYPE_PAGE);
if (isNotNull(sortOrder) && isNotNull(sortName)) {
baseExample.setOrderByClause(baseExample.getTableAlias() + "." + sortName + " " + sortOrder);
} else if (isNotNull(sortName) && !isNotNull(sortOrder)) {
baseExample.setOrderByClause(sortName);
}
if (page <= 0) {
List result = getService().selectByExample(baseExample);
return getSuccessJsonMsg(MESSAGE_SELECT_SUCCESS, result);
} else {
PageInfo pageInfo = getService().pagedQuery(baseExample, page, pageSize);
return getSuccessJsonMsg(MESSAGE_PAGE_SUCCESS, pageInfo);
}
}
/**
* 根据参数获取图片,对前后获取图片的不同参数方式进行兼容
*/
@RequestMapping(value = "/img/{location}/{picture:.+}")
public void getIMG(@PathVariable("picture") String picture, @PathVariable("location") String location, HttpServletResponse response) {
if (picture.contains("svg")) {
response.setContentType("image/svg+xml;charset=UTF-8");
response.addHeader("Accept-Ranges", "bytes");
} else {
response.setContentType("image/jpeg");
}
FileInputStream fis = null;
OutputStream out = null;
try {
String basePath = FileUtil.getBasePath();
File file = new File(basePath + "/" + location, picture);
if (!file.exists()) {
System.out.println(file.getAbsolutePath());
return;
}
out = response.getOutputStream();
fis = new FileInputStream(file);
byte[] b = new byte[fis.available()];
response.setContentLength(b.length);
fis.read(b);
out.write(b);
out.flush();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (fis != null) {
fis.close();
}
} catch (Exception e) {
e.printStackTrace();
}
try {
if (out != null) {
out.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 获取到执行各项操作需要的service
*
* @return
*/
protected abstract BaseService<O> getService();
/**
* 得到执行查询操作需要的查询条件
*
* @param t 查询条件存储对象
*
* @return 查询条件对象
*/
protected abstract BaseExample getExample(T t, int type);
}
package com.viontech.label.platform.base;
import java.util.*;
/**
* 所有Example都需要继承自该类<br>
* 该类自动生成不需要修改
* @author suman
* 2016年8月15日 下午1:58:40
*/
public abstract class BaseExample {
protected String orderByClause;
protected String groupByClause;
protected boolean distinct;
protected boolean ignoreCase;
protected String tableName;
protected String tableAlias;
protected List<GeneratedCriteria> oredCriteria;
protected Map<String, ColumnContainerBase> columnContainerMap;
protected Set<String> leftJoinTableSet;
public BaseExample() {
oredCriteria = new ArrayList<GeneratedCriteria>();
columnContainerMap = new HashMap<String,ColumnContainerBase>();
leftJoinTableSet = new HashSet<String>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
if(orderByClause == null){
return getTableAlias()+".id";
}
return orderByClause;
}
public void setGroupByClause(String groupByClause) {
this.groupByClause = groupByClause;
}
public String getGroupByClause() {
return groupByClause;
}
public String getTableName() {
return tableName;
}
public String getTableAlias() {
return "\""+tableAlias+"\"";
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public boolean isIgnoreCase() {
return ignoreCase;
}
public void setIgnoreCase(boolean ignoreCase) {
this.ignoreCase = ignoreCase;
oredCriteria.forEach(item ->{
item.setIgnoreCase(this.ignoreCase);
});
}
public List<GeneratedCriteria> getOredCriteria() {
return oredCriteria;
}
public Set<ColumnContainerBase> getColumnContainerSet() {
if(columnContainerMap.size()==0){
columnContainerMap.put(getTableName(), createColumns());
}
return new HashSet(columnContainerMap.values());
}
public Set<String> getLeftJoinTableSet() {
return leftJoinTableSet;
}
public void or(GeneratedCriteria criteria) {
oredCriteria.add(criteria);
if(!criteria.getTableName().equals(getTableName())){
leftJoinTableSet.add(criteria.getTableName());
}
}
public GeneratedCriteria and(GeneratedCriteria criteria) {
GeneratedCriteria oldCriteria = criteria;
if(oredCriteria.size()<=0){
oredCriteria.add(criteria);
}else{
oldCriteria = oredCriteria.get(oredCriteria.size()-1);
oldCriteria.getCriteria().addAll(criteria.getCriteria());
}
if(!criteria.getTableName().equals(getTableName())){
leftJoinTableSet.add(criteria.getTableName());
}
return oldCriteria;
}
public abstract GeneratedCriteria createCriteria();
protected abstract GeneratedCriteria createCriteriaInternal();
protected abstract ColumnContainerBase createColumns();
public void clear() {
oredCriteria.clear();
columnContainerMap.clear();
leftJoinTableSet.clear();
orderByClause = null;
groupByClause = null;
distinct = false;
ignoreCase = false;
}
public abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected boolean ignoreCase = false;
private String tableName;
public boolean isIgnoreCase() {
return ignoreCase;
}
public void setIgnoreCase(boolean ignoreCase) {
this.ignoreCase = ignoreCase;
this.criteria.forEach(item->{
item.setIgnoreCase(ignoreCase);
});
}
protected GeneratedCriteria(String tableName) {
super();
this.criteria = new ArrayList<Criterion>();
this.tableName = tableName;
}
protected GeneratedCriteria(String tableName,boolean ignoreCase) {
this(tableName);
this.ignoreCase = ignoreCase;
}
public List<Criterion> getCriteria() {
return criteria;
}
public void setCriteria(List<Criterion> criteria){
this.criteria = criteria;
}
public String getTableName() {
return tableName;
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
private boolean ignoreCase;
public String getCondition() {
return condition;
}
public void setCondition(String condition){
this.condition = condition;
}
public Object getValue() {
return value;
}
public void setValue(Object value){
this.value = value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public void setNoValue(boolean noValue) {
this.noValue = noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public void setSingleValue(boolean singleValue){
this.singleValue = singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public void setListValue(boolean listValue){
this.listValue = listValue;
}
public String getTypeHandler() {
return typeHandler;
}
public boolean isIgnoreCase() {
return ignoreCase;
}
public void setIgnoreCase(boolean ignoreCase) {
this.ignoreCase = ignoreCase;
if(ignoreCase && value instanceof String){
String[] conditions = condition.split(" ");
this.condition = "\"upper\"("+conditions[0]+") " + conditions[1];
this.value = String.valueOf(value).toUpperCase();
}
}
public Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
public Criterion(String condition, Object value, String typeHandler) {
this(condition,value,typeHandler,false);
}
public Criterion(String condition, Object value, String typeHandler,boolean ignoreCase) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
if(ignoreCase && value instanceof String){
String[] conditions = condition.split(" ");
this.condition = "\"upper\"("+conditions[0]+") " + conditions[1];
this.value = String.valueOf(value).toUpperCase();
}
}
public Criterion(String condition, Object value) {
this(condition,value,false);
}
public Criterion(String condition, Object value,boolean ignoreCase) {
this(condition, value, null,ignoreCase);
}
public Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
public Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
protected static class ColumnContainerBase {
private StringBuffer columnContainerStr;
private String tableName;
protected ColumnContainerBase(String tableName) {
super();
columnContainerStr = new StringBuffer();
this.tableName = tableName;
}
public boolean isValid() {
return columnContainerStr.length() > 0;
}
public StringBuffer getAllColumn() {
return columnContainerStr;
}
public StringBuffer getColumnContainerStr() {
return columnContainerStr;
}
public void addColumnStr(String column) {
if(columnContainerStr.toString().indexOf(column)!=-1){
return;
}
if (columnContainerStr.length() > 0) {
columnContainerStr.append(",");
}
columnContainerStr.append(column);
}
public String getTableName() {
return tableName;
}
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.base;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
* @author suman
* 2016年8月15日 下午1:52:06
* @param <T>
*/
public interface BaseMapper<T extends BaseModel> {
/**
* 通过查询条件获取满足条件的数据数量
* @param example 查询条件
* @return 满足条件的数据数量
*/
public int countByExample(BaseExample example);
/**
* 通过条件删除数据
* @param example 条件
* @return 删除数量
*/
public int deleteByExample(BaseExample example);
/**
* 通过主键删除数据
* @param key 主键
* @return 删除数量
*/
public int deleteByPrimaryKey(Object id);
/**
* 将数据插入数据库<br>
* 所有字段都插入数据库不管是不是null
* @param record 需要插入数据库的对象
* @return
*/
public int insert(T record);
/**
* 将数据插入数据库<br>
* 将所有非null字段都插入数据库
* @param record
* @return
*/
public int insertSelective(T record);
/**
* 通过查询条件查询数据
* @param example 查询条件
* @return 数据对象列表
*/
public List<T> selectByExample(BaseExample example);
/**
* 通过主键查询数据
* @param key 主键
* @return 数据对象
*/
public T selectByPrimaryKey(Object id);
/**
* 通过条件更新数据<br>
* 更新所有字段
* @param record 需要更新的内容
* @param example 更新的条件
* @return 更新的数据数量
*/
public int updateByExampleSelective(@Param("record") T record, @Param("example") BaseExample example);
/**
* 通过条件更新数据<br>
* 更新所有字段
* @param record 需要更新的内容
* @param example 更新的条件
* @return 更新的数据数量
*/
public int updateByExample(@Param("record") T record, @Param("example") BaseExample example);
/**
* 通过主键更新对象<br>
* 只更新非null字段
* @param record 需要更新的内容及主键 主键不可为空
* @return 更新的数量
*/
public int updateByPrimaryKeySelective(T record);
/**
* 通过主键更新对象<br>
* 更新所有字段
* @param record 需要更新的内容及主键 主键不可为空
* @return 更新的数量
*/
public int updateByPrimaryKey(T record);
}
package com.viontech.label.platform.base;
import java.io.Serializable;
/**
*
* @author suman
* model类的基类 所有的model都要继承自该类
*/
public abstract class BaseModel implements Serializable{
private Long count;
private Long id;
public BaseModel() {
super();
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
package com.viontech.label.platform.base;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* Service接口的基本接口,所有Service接口必须继承
* @author suman
*
* @param <T> 操作对应的model
*/
public interface BaseService<T extends BaseModel>{
/**
* 获取service对应的Mapper来进行操作
* @return
*/
public abstract BaseMapper<T> getMapper();
/**
* 通过查询条件获取满足条件的数据数量
* @param example 查询条件
* @return 满足条件的数据数量
*/
int countByExample(BaseExample example);
/**
* 通过条件删除数据
* @param example 条件
* @return 删除数量
*/
int deleteByExample(BaseExample example);
/**
* 通过主键删除数据
* @param key 主键
* @return 删除数量
*/
int deleteByPrimaryKey(Object key);
/**
* 将数据插入数据库<br>
* 所有字段都插入数据库不管是不是null
* @param record 需要插入数据库的对象
* @return
*/
T insert(T record);
/**
* 将数据插入数据库<br>
* 将所有非null字段都插入数据库
* @param record
* @return
*/
T insertSelective(T record);
/**
* 通过查询条件查询数据
* @param example 查询条件
* @return 数据对象列表
*/
List<T> selectByExample(BaseExample example);
/**
* 通过主键查询数据
* @param key 主键
* @return 数据对象
*/
T selectByPrimaryKey(Object key);
/**
* 通过条件更新数据<br>
* 只更新非null字段
* @param record 需要更新的内容
* @param example 更新的条件
* @return 更新的数据数量
*/
int updateByExampleSelective(T record, BaseExample example);
/**
* 通过条件更新数据<br>
* 更新所有字段
* @param record 需要更新的内容
* @param example 更新的条件
* @return 更新的数据数量
*/
int updateByExample(T record,BaseExample example);
/**
* 通过主键更新对象<br>
* 只更新非null字段
* @param record 需要更新的内容及主键 主键不可为空
* @return 更新的数量
*/
int updateByPrimaryKeySelective(T record);
/**
* 通过主键更新对象<br>
* 更新所有字段
* @param record 需要更新的内容及主键 主键不可为空
* @return 更新的数量
*/
int updateByPrimaryKey(T record);
/**
* 通过查询条件和分页条件查询出一页数据
* @param example 查询条件
* @param page 页数
* @param limit 每页数据数量
* @return 一页数据
*/
PageInfo pagedQuery(BaseExample example, int page, int pageSize);
Object getPKByModel(BaseModel baseModel);
List getIdsByByExample(BaseExample example);
/**
* 根据实体属性名称获取对应表字段名称
* @param property
* @return
*/
String getColumnNameByProperty(String property);
}
package com.viontech.label.platform.base;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.viontech.label.core.base.RedisCache;
import org.apache.ibatis.mapping.ResultMap;
import org.apache.ibatis.mapping.ResultMapping;
import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Field;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public abstract class BaseServiceImpl<T extends BaseModel> implements BaseService<T> {
/**
* slf4j 日志对象 用来记录log
*/
protected Logger logger = LoggerFactory.getLogger(getClass());
private Map<String, String> columnNamePropertyMap = null;
@RedisCache(methodType = RedisCache.MethodType.GET)
public T selectByPrimaryKey(Object id) {
return getMapper().selectByPrimaryKey(id);
}
@RedisCache(methodType = RedisCache.MethodType.ADD)
public T insert(T record) {
getMapper().insert(record);
return record;
}
@Override
@RedisCache(methodType = RedisCache.MethodType.ADD)
public T insertSelective(T record) {
getMapper().insertSelective(record);
return record;
}
@Override
@RedisCache(methodType = RedisCache.MethodType.DELETE)
public int deleteByPrimaryKey(Object b) {
return getMapper().deleteByPrimaryKey(b);
}
@Override
@RedisCache(methodType = RedisCache.MethodType.UPDATE)
public int updateByPrimaryKey(T record) {
return getMapper().updateByPrimaryKey(record);
}
@Override
@RedisCache(methodType = RedisCache.MethodType.UPDATE)
public int updateByPrimaryKeySelective(T record) {
return getMapper().updateByPrimaryKeySelective(record);
}
@Override
@RedisCache(methodType = RedisCache.MethodType.GET)
public PageInfo<T> pagedQuery(BaseExample example, int pageNum, int pageSize) {
if (pageSize > 0) {
PageHelper.startPage(pageNum, pageSize);
Page<T> result = (Page<T>) getMapper().selectByExample(example);
PageInfo<T> pageInfo = new PageInfo<T>(result);
return pageInfo;
} else {
List<T> result = (List<T>) getMapper().selectByExample(example);
Page<T> p = new Page<T>();
p.addAll(result);
PageInfo<T> pageInfo = new PageInfo<T>(p);
return pageInfo;
}
}
@Override
public int countByExample(BaseExample example) {
return getMapper().countByExample(example);
}
@Override
@RedisCache(methodType = RedisCache.MethodType.DELETE)
public int deleteByExample(BaseExample example) {
return getMapper().deleteByExample(example);
}
@Override
@RedisCache(methodType = RedisCache.MethodType.GET)
public List<T> selectByExample(BaseExample example) {
return getMapper().selectByExample(example);
}
@Override
@RedisCache(methodType = RedisCache.MethodType.UPDATE)
public int updateByExampleSelective(T record, BaseExample example) {
return getMapper().updateByExampleSelective(record, example);
}
@Override
@RedisCache(methodType = RedisCache.MethodType.UPDATE)
public int updateByExample(T record, BaseExample example) {
return getMapper().updateByExample(record, example);
}
@Override
public List<Object> getIdsByByExample(BaseExample example) {
List<T> list = selectByExample(example);
List<Object> result = new ArrayList<Object>();
for (T t : list) {
Object pk = getPKByModel(t);
if (pk != null) {
result.add(pk);
}
}
return result;
}
@Override
public Object getPKByModel(BaseModel baseModel) {
throw new UnsupportedOperationException();
}
public String getColumnNameByProperty(String property) {
if (columnNamePropertyMap == null) {
columnNamePropertyMap = getColumnNamePropertyMap();
}
return columnNamePropertyMap.get(property);
}
public Map getColumnNamePropertyMap() {
Map<String, String> result = new HashMap<String, String>();
try {
SqlSession sqlSession = getSqlSessionByMapper(getMapper());
ResultMap resultMap = sqlSession.getConfiguration().getResultMap(getMapperClassByMapper(getMapper()).getName() + ".BaseResultMapRoot");
List<ResultMapping> propertyResultMappings = resultMap.getPropertyResultMappings();
for (ResultMapping resultMapping : propertyResultMappings) {
result.put(resultMapping.getProperty(), resultMapping.getColumn());
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
private SqlSession getSqlSessionByMapper(BaseMapper mapper) throws Exception {
Object mapperProxy = ((Proxy) mapper).getInvocationHandler(mapper);
Field sqlSession = mapperProxy.getClass().getDeclaredField("sqlSession");
sqlSession.setAccessible(true);
return (SqlSession) sqlSession.get(mapperProxy);
}
private Class getMapperClassByMapper(BaseMapper mapper) throws Exception {
Object mapperProxy = ((Proxy) mapper).getInvocationHandler(mapper);
Field mapperInterface = mapperProxy.getClass().getDeclaredField("mapperInterface");
mapperInterface.setAccessible(true);
return (Class) mapperInterface.get(mapperProxy);
}
}
package com.viontech.label.platform.base;
import cn.dev33.satoken.exception.NotLoginException;
import com.viontech.keliu.util.JsonMessageUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
* .
*
* @author 谢明辉
* @date 2020/6/4
*/
@RestControllerAdvice
public class GlobalExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@ExceptionHandler
public Object exceptionHandler(Exception e) {
if (!(e instanceof NotLoginException)) {
log.error("接口调用出错", e);
}
return JsonMessageUtil.getErrorJsonMsg(e.getMessage());
}
}
package com.viontech.label.platform.base;
public interface VoInterface<T> {
public T getModel();
public void setModel(T t);
}
package com.viontech.label.platform.config;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* 不通过注入的方式取得bean
*
* @author 谢明辉
* @date 2019-5-20
*/
@Component
public class ApplicationContextProvider implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
ApplicationContextProvider.applicationContext = applicationContext;
}
/**
* 获取applicationContext
*/
public static ApplicationContext getApplicationContext() {
return applicationContext;
}
/**
* 通过name获取 Bean.
*
* @param name
*/
public static Object getBean(String name) {
return getApplicationContext().getBean(name);
}
/**
* 通过class获取Bean.
*
* @param clazz
* @param <T>
*/
public static <T> T getBean(Class<T> clazz) {
return getApplicationContext().getBean(clazz);
}
/**
* 通过name,以及Clazz返回指定的Bean
*
* @param name
* @param clazz
* @param <T>
*/
public static <T> T getBean(String name, Class<T> clazz) {
return getApplicationContext().getBean(name, clazz);
}
}
package com.viontech.label.platform.config;
import org.nustaq.serialization.FSTConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* .
*
* @author 谢明辉
* @date 2021/5/26
*/
@Configuration
@AutoConfigureAfter(RedisAutoConfiguration.class)
public class RedisConfig extends CachingConfigurerSupport {
@Bean
public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) {
RedisTemplate redisTemplate = new RedisTemplate();
//给redis模板先设置连接工厂,在设置序列化规则
redisTemplate.setConnectionFactory(redisConnectionFactory);
//设置序列化规则
FSTSerializer fstSerializer = new FSTSerializer();
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setValueSerializer(fstSerializer);
redisTemplate.setHashKeySerializer(fstSerializer);
redisTemplate.setHashValueSerializer(fstSerializer);
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
private static class FSTSerializer implements RedisSerializer<Object> {
private final static ThreadLocal<FSTConfiguration> FST_CONFIG = ThreadLocal.withInitial(FSTConfiguration::createDefaultConfiguration);
@Override
public byte[] serialize(Object obj) {
if (null == obj) {
return null;
}
return FST_CONFIG.get().asByteArray(obj);
}
@Override
public Object deserialize(byte[] bytes) {
if (null == bytes || bytes.length == 0) {
return null;
}
return FST_CONFIG.get().asObject(bytes);
}
}
}
package com.viontech.label.platform.config;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.codec.FstCodec;
import org.redisson.config.Config;
import org.redisson.config.SingleServerConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
/**
* .
*
* @author 谢明辉
* @date 2019-8-7 9:30
*/
@Configuration
public class RedissonConfig {
@Value("${spring.redis.host:127.0.0.1}")
private String host;
@Value("${spring.redis.port:6379}")
private Integer port;
@Value("${spring.redis.password:vionredis}")
private String password;
@Value("${spring.redis.database:0}")
private Integer database;
@Bean(name = "redissonClient", destroyMethod = "shutdown")
@ConditionalOnProperty(name = "spring.redis.host")
public RedissonClient redissonClient() {
Config config = new Config();
SingleServerConfig singleServerConfig = config.useSingleServer();
singleServerConfig.setAddress("redis://" + host + ":" + port);
singleServerConfig.setPassword(password);
singleServerConfig.setDatabase(database);
singleServerConfig.setConnectionMinimumIdleSize(10);
singleServerConfig.setConnectionPoolSize(20);
singleServerConfig.setDnsMonitoringInterval(5000);
config.setCodec(new FstCodec());
return Redisson.create(config);
}
@Bean(name = "redissonClient", destroyMethod = "shutdown")
@ConditionalOnProperty(name = "spring.redis.cluster.nodes")
@ConditionalOnMissingBean(RedissonClient.class)
public RedissonClient redissonClientCluster(@Value("${spring.redis.cluster.nodes}") String nodesStr) {
String[] split = nodesStr.split(",");
for (int i = 0; i < split.length; i++) {
split[i] = "redis://" + split[i];
}
Config config = new Config();
config.useClusterServers()
// 集群状态扫描间隔时间,单位是毫秒
.setScanInterval(2000)
//可以用"rediss://"来启用SSL连接
.addNodeAddress(split)
.setPassword(password)
.setSlaveConnectionPoolSize(10)
.setSlaveConnectionMinimumIdleSize(5)
.setTimeout((int) TimeUnit.MINUTES.toMillis(5));
config.setCodec(new FstCodec());
return Redisson.create(config);
}
@Bean(name = "redissonClient", destroyMethod = "shutdown")
@ConditionalOnProperty(name = "spring.redis.sentinel.nodes")
@ConditionalOnMissingBean(RedissonClient.class)
public RedissonClient redissonClientSentinel(@Value("${spring.redis.sentinel.nodes}") String nodesStr, @Value("${spring.redis.sentinel.master}") String master) {
String[] split = nodesStr.split(",");
for (int i = 0; i < split.length; i++) {
split[i] = "redis://" + split[i];
}
Config config = new Config();
config.useSentinelServers()
.setMasterName(master)
.addSentinelAddress(split)
.setPassword(password)
.setSlaveConnectionPoolSize(10)
.setSlaveConnectionMinimumIdleSize(5)
.setTimeout((int) TimeUnit.MINUTES.toMillis(5));
config.setCodec(new FstCodec());
return Redisson.create(config);
}
}
package com.viontech.label.platform.config;
import com.viontech.keliu.websocket.AlgApiClient;
import com.viontech.label.core.base.DateConverter;
import com.viontech.label.platform.interceptor.AuthInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
import javax.annotation.Resource;
import java.util.Date;
/**
* .
*
* @author 谢明辉
* @date 2021/5/26
*/
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Resource
private AuthInterceptor authInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns("/users/login", "/reid/upload","/**/websocket/**");
}
@Bean
public Converter<String, Date> addNewConvert() {
return new DateConverter();
}
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
@Bean
public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.addAllowedOrigin("*");
config.setAllowCredentials(true);
config.addAllowedMethod("*");
config.addAllowedHeader("*");
config.setMaxAge(3600L);
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
configSource.registerCorsConfiguration("/**", config);
return new CorsFilter(configSource);
}
@Bean("matchClient")
@ConditionalOnProperty(value = "vion.match-url")
public AlgApiClient algApiClient(@Value("${vion.match-url}") String matchUrl) {
return new AlgApiClient(matchUrl);
}
}
package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.model.Account;
import com.viontech.label.platform.model.AccountExample;
import com.viontech.label.platform.service.adapter.AccountService;
import com.viontech.label.platform.vo.AccountVo;
import javax.annotation.Resource;
public abstract class AccountBaseController extends BaseController<Account, AccountVo> {
@Resource
protected AccountService accountService;
@Override
protected BaseExample getExample(AccountVo accountVo, int type) {
AccountExample accountExample = new AccountExample();
AccountExample.Criteria criteria = accountExample.createCriteria();
if(accountVo.getId() != null) {
criteria.andIdEqualTo(accountVo.getId());
}
if(accountVo.getId_arr() != null) {
criteria.andIdIn(accountVo.getId_arr());
}
if(accountVo.getId_gt() != null) {
criteria.andIdGreaterThan(accountVo.getId_gt());
}
if(accountVo.getId_lt() != null) {
criteria.andIdLessThan(accountVo.getId_lt());
}
if(accountVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(accountVo.getId_gte());
}
if(accountVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(accountVo.getId_lte());
}
if(accountVo.getUnid() != null) {
criteria.andUnidEqualTo(accountVo.getUnid());
}
if(accountVo.getUnid_arr() != null) {
criteria.andUnidIn(accountVo.getUnid_arr());
}
if(accountVo.getUnid_like() != null) {
criteria.andUnidLike(accountVo.getUnid_like());
}
if(accountVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(accountVo.getCreateTime());
}
if(accountVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(accountVo.getCreateTime_arr());
}
if(accountVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(accountVo.getCreateTime_gt());
}
if(accountVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(accountVo.getCreateTime_lt());
}
if(accountVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(accountVo.getCreateTime_gte());
}
if(accountVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(accountVo.getCreateTime_lte());
}
if(accountVo.getCreateUser() != null) {
criteria.andCreateUserEqualTo(accountVo.getCreateUser());
}
if(accountVo.getCreateUser_null() != null) {
if(accountVo.getCreateUser_null().booleanValue()) {
criteria.andCreateUserIsNull();
} else {
criteria.andCreateUserIsNotNull();
}
}
if(accountVo.getCreateUser_arr() != null) {
criteria.andCreateUserIn(accountVo.getCreateUser_arr());
}
if(accountVo.getCreateUser_gt() != null) {
criteria.andCreateUserGreaterThan(accountVo.getCreateUser_gt());
}
if(accountVo.getCreateUser_lt() != null) {
criteria.andCreateUserLessThan(accountVo.getCreateUser_lt());
}
if(accountVo.getCreateUser_gte() != null) {
criteria.andCreateUserGreaterThanOrEqualTo(accountVo.getCreateUser_gte());
}
if(accountVo.getCreateUser_lte() != null) {
criteria.andCreateUserLessThanOrEqualTo(accountVo.getCreateUser_lte());
}
if(accountVo.getName() != null) {
criteria.andNameEqualTo(accountVo.getName());
}
if(accountVo.getName_arr() != null) {
criteria.andNameIn(accountVo.getName_arr());
}
if(accountVo.getName_like() != null) {
criteria.andNameLike(accountVo.getName_like());
}
if(accountVo.getManagerId() != null) {
criteria.andManagerIdEqualTo(accountVo.getManagerId());
}
if(accountVo.getManagerId_null() != null) {
if(accountVo.getManagerId_null().booleanValue()) {
criteria.andManagerIdIsNull();
} else {
criteria.andManagerIdIsNotNull();
}
}
if(accountVo.getManagerId_arr() != null) {
criteria.andManagerIdIn(accountVo.getManagerId_arr());
}
if(accountVo.getManagerId_gt() != null) {
criteria.andManagerIdGreaterThan(accountVo.getManagerId_gt());
}
if(accountVo.getManagerId_lt() != null) {
criteria.andManagerIdLessThan(accountVo.getManagerId_lt());
}
if(accountVo.getManagerId_gte() != null) {
criteria.andManagerIdGreaterThanOrEqualTo(accountVo.getManagerId_gte());
}
if(accountVo.getManagerId_lte() != null) {
criteria.andManagerIdLessThanOrEqualTo(accountVo.getManagerId_lte());
}
if(accountVo.getDescription() != null) {
criteria.andDescriptionEqualTo(accountVo.getDescription());
}
if(accountVo.getDescription_null() != null) {
if(accountVo.getDescription_null().booleanValue()) {
criteria.andDescriptionIsNull();
} else {
criteria.andDescriptionIsNotNull();
}
}
if(accountVo.getDescription_arr() != null) {
criteria.andDescriptionIn(accountVo.getDescription_arr());
}
if(accountVo.getDescription_like() != null) {
criteria.andDescriptionLike(accountVo.getDescription_like());
}
return accountExample;
}
@Override
protected BaseService<Account> getService() {
return accountService;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.model.Dict;
import com.viontech.label.platform.model.DictExample;
import com.viontech.label.platform.service.adapter.DictService;
import com.viontech.label.platform.vo.DictVo;
import javax.annotation.Resource;
public abstract class DictBaseController extends BaseController<Dict, DictVo> {
@Resource
protected DictService dictService;
@Override
protected BaseExample getExample(DictVo dictVo, int type) {
DictExample dictExample = new DictExample();
DictExample.Criteria criteria = dictExample.createCriteria();
if(dictVo.getId() != null) {
criteria.andIdEqualTo(dictVo.getId());
}
if(dictVo.getId_arr() != null) {
criteria.andIdIn(dictVo.getId_arr());
}
if(dictVo.getId_gt() != null) {
criteria.andIdGreaterThan(dictVo.getId_gt());
}
if(dictVo.getId_lt() != null) {
criteria.andIdLessThan(dictVo.getId_lt());
}
if(dictVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(dictVo.getId_gte());
}
if(dictVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(dictVo.getId_lte());
}
if(dictVo.getUnid() != null) {
criteria.andUnidEqualTo(dictVo.getUnid());
}
if(dictVo.getUnid_arr() != null) {
criteria.andUnidIn(dictVo.getUnid_arr());
}
if(dictVo.getUnid_like() != null) {
criteria.andUnidLike(dictVo.getUnid_like());
}
if(dictVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(dictVo.getCreateTime());
}
if(dictVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(dictVo.getCreateTime_arr());
}
if(dictVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(dictVo.getCreateTime_gt());
}
if(dictVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(dictVo.getCreateTime_lt());
}
if(dictVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(dictVo.getCreateTime_gte());
}
if(dictVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(dictVo.getCreateTime_lte());
}
if(dictVo.getCreateUser() != null) {
criteria.andCreateUserEqualTo(dictVo.getCreateUser());
}
if(dictVo.getCreateUser_null() != null) {
if(dictVo.getCreateUser_null().booleanValue()) {
criteria.andCreateUserIsNull();
} else {
criteria.andCreateUserIsNotNull();
}
}
if(dictVo.getCreateUser_arr() != null) {
criteria.andCreateUserIn(dictVo.getCreateUser_arr());
}
if(dictVo.getCreateUser_gt() != null) {
criteria.andCreateUserGreaterThan(dictVo.getCreateUser_gt());
}
if(dictVo.getCreateUser_lt() != null) {
criteria.andCreateUserLessThan(dictVo.getCreateUser_lt());
}
if(dictVo.getCreateUser_gte() != null) {
criteria.andCreateUserGreaterThanOrEqualTo(dictVo.getCreateUser_gte());
}
if(dictVo.getCreateUser_lte() != null) {
criteria.andCreateUserLessThanOrEqualTo(dictVo.getCreateUser_lte());
}
if(dictVo.getKey() != null) {
criteria.andKeyEqualTo(dictVo.getKey());
}
if(dictVo.getKey_arr() != null) {
criteria.andKeyIn(dictVo.getKey_arr());
}
if(dictVo.getKey_like() != null) {
criteria.andKeyLike(dictVo.getKey_like());
}
if(dictVo.getValue() != null) {
criteria.andValueEqualTo(dictVo.getValue());
}
if(dictVo.getValue_arr() != null) {
criteria.andValueIn(dictVo.getValue_arr());
}
if(dictVo.getValue_gt() != null) {
criteria.andValueGreaterThan(dictVo.getValue_gt());
}
if(dictVo.getValue_lt() != null) {
criteria.andValueLessThan(dictVo.getValue_lt());
}
if(dictVo.getValue_gte() != null) {
criteria.andValueGreaterThanOrEqualTo(dictVo.getValue_gte());
}
if(dictVo.getValue_lte() != null) {
criteria.andValueLessThanOrEqualTo(dictVo.getValue_lte());
}
if(dictVo.getDescription() != null) {
criteria.andDescriptionEqualTo(dictVo.getDescription());
}
if(dictVo.getDescription_null() != null) {
if(dictVo.getDescription_null().booleanValue()) {
criteria.andDescriptionIsNull();
} else {
criteria.andDescriptionIsNotNull();
}
}
if(dictVo.getDescription_arr() != null) {
criteria.andDescriptionIn(dictVo.getDescription_arr());
}
if(dictVo.getDescription_like() != null) {
criteria.andDescriptionLike(dictVo.getDescription_like());
}
return dictExample;
}
@Override
protected BaseService<Dict> getService() {
return dictService;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.mapper.LogMapper;
import com.viontech.label.platform.model.Log;
import com.viontech.label.platform.model.LogExample;
import com.viontech.label.platform.service.adapter.LogService;
import com.viontech.label.platform.vo.LogVo;
import javax.annotation.Resource;
public abstract class LogBaseController extends BaseController<Log, LogVo> {
@Resource
protected LogService logService;
@Override
protected BaseExample getExample(LogVo logVo, int type) {
LogExample logExample = new LogExample();
LogExample.Criteria criteria = logExample.createCriteria();
if(logVo.getId() != null) {
criteria.andIdEqualTo(logVo.getId());
}
if(logVo.getId_arr() != null) {
criteria.andIdIn(logVo.getId_arr());
}
if(logVo.getId_gt() != null) {
criteria.andIdGreaterThan(logVo.getId_gt());
}
if(logVo.getId_lt() != null) {
criteria.andIdLessThan(logVo.getId_lt());
}
if(logVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(logVo.getId_gte());
}
if(logVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(logVo.getId_lte());
}
if(logVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(logVo.getCreateTime());
}
if(logVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(logVo.getCreateTime_arr());
}
if(logVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(logVo.getCreateTime_gt());
}
if(logVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(logVo.getCreateTime_lt());
}
if(logVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(logVo.getCreateTime_gte());
}
if(logVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(logVo.getCreateTime_lte());
}
if(logVo.getOperateUser() != null) {
criteria.andOperateUserEqualTo(logVo.getOperateUser());
}
if(logVo.getOperateUser_arr() != null) {
criteria.andOperateUserIn(logVo.getOperateUser_arr());
}
if(logVo.getOperateUser_gt() != null) {
criteria.andOperateUserGreaterThan(logVo.getOperateUser_gt());
}
if(logVo.getOperateUser_lt() != null) {
criteria.andOperateUserLessThan(logVo.getOperateUser_lt());
}
if(logVo.getOperateUser_gte() != null) {
criteria.andOperateUserGreaterThanOrEqualTo(logVo.getOperateUser_gte());
}
if(logVo.getOperateUser_lte() != null) {
criteria.andOperateUserLessThanOrEqualTo(logVo.getOperateUser_lte());
}
if(logVo.getOperateDate() != null) {
criteria.andOperateDateEqualTo(logVo.getOperateDate());
}
if(logVo.getOperateDate_arr() != null) {
criteria.andOperateDateIn(logVo.getOperateDate_arr());
}
if(logVo.getOperateDate_gt() != null) {
criteria.andOperateDateGreaterThan(logVo.getOperateDate_gt());
}
if(logVo.getOperateDate_lt() != null) {
criteria.andOperateDateLessThan(logVo.getOperateDate_lt());
}
if(logVo.getOperateDate_gte() != null) {
criteria.andOperateDateGreaterThanOrEqualTo(logVo.getOperateDate_gte());
}
if(logVo.getOperateDate_lte() != null) {
criteria.andOperateDateLessThanOrEqualTo(logVo.getOperateDate_lte());
}
if(logVo.getOperateType() != null) {
criteria.andOperateTypeEqualTo(logVo.getOperateType());
}
if(logVo.getOperateType_null() != null) {
if(logVo.getOperateType_null().booleanValue()) {
criteria.andOperateTypeIsNull();
} else {
criteria.andOperateTypeIsNotNull();
}
}
if(logVo.getOperateType_arr() != null) {
criteria.andOperateTypeIn(logVo.getOperateType_arr());
}
if(logVo.getOperateType_gt() != null) {
criteria.andOperateTypeGreaterThan(logVo.getOperateType_gt());
}
if(logVo.getOperateType_lt() != null) {
criteria.andOperateTypeLessThan(logVo.getOperateType_lt());
}
if(logVo.getOperateType_gte() != null) {
criteria.andOperateTypeGreaterThanOrEqualTo(logVo.getOperateType_gte());
}
if(logVo.getOperateType_lte() != null) {
criteria.andOperateTypeLessThanOrEqualTo(logVo.getOperateType_lte());
}
if(logVo.getOperate() != null) {
criteria.andOperateEqualTo(logVo.getOperate());
}
if(logVo.getOperate_null() != null) {
if(logVo.getOperate_null().booleanValue()) {
criteria.andOperateIsNull();
} else {
criteria.andOperateIsNotNull();
}
}
if(logVo.getOperate_arr() != null) {
criteria.andOperateIn(logVo.getOperate_arr());
}
if(logVo.getOperate_like() != null) {
criteria.andOperateLike(logVo.getOperate_like());
}
return logExample;
}
@Override
protected BaseService<Log> getService() {
return logService;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.mapper.PackMapper;
import com.viontech.label.platform.model.Pack;
import com.viontech.label.platform.model.PackExample;
import com.viontech.label.platform.service.adapter.PackService;
import com.viontech.label.platform.vo.PackVo;
import javax.annotation.Resource;
public abstract class PackBaseController extends BaseController<Pack, PackVo> {
@Resource
protected PackService packService;
@Override
protected BaseExample getExample(PackVo packVo, int type) {
PackExample packExample = new PackExample();
PackExample.Criteria criteria = packExample.createCriteria();
if(packVo.getId() != null) {
criteria.andIdEqualTo(packVo.getId());
}
if(packVo.getId_arr() != null) {
criteria.andIdIn(packVo.getId_arr());
}
if(packVo.getId_gt() != null) {
criteria.andIdGreaterThan(packVo.getId_gt());
}
if(packVo.getId_lt() != null) {
criteria.andIdLessThan(packVo.getId_lt());
}
if(packVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(packVo.getId_gte());
}
if(packVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(packVo.getId_lte());
}
if(packVo.getUnid() != null) {
criteria.andUnidEqualTo(packVo.getUnid());
}
if(packVo.getUnid_arr() != null) {
criteria.andUnidIn(packVo.getUnid_arr());
}
if(packVo.getUnid_like() != null) {
criteria.andUnidLike(packVo.getUnid_like());
}
if(packVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(packVo.getCreateTime());
}
if(packVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(packVo.getCreateTime_arr());
}
if(packVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(packVo.getCreateTime_gt());
}
if(packVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(packVo.getCreateTime_lt());
}
if(packVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(packVo.getCreateTime_gte());
}
if(packVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(packVo.getCreateTime_lte());
}
if(packVo.getCreateUser() != null) {
criteria.andCreateUserEqualTo(packVo.getCreateUser());
}
if(packVo.getCreateUser_null() != null) {
if(packVo.getCreateUser_null().booleanValue()) {
criteria.andCreateUserIsNull();
} else {
criteria.andCreateUserIsNotNull();
}
}
if(packVo.getCreateUser_arr() != null) {
criteria.andCreateUserIn(packVo.getCreateUser_arr());
}
if(packVo.getCreateUser_gt() != null) {
criteria.andCreateUserGreaterThan(packVo.getCreateUser_gt());
}
if(packVo.getCreateUser_lt() != null) {
criteria.andCreateUserLessThan(packVo.getCreateUser_lt());
}
if(packVo.getCreateUser_gte() != null) {
criteria.andCreateUserGreaterThanOrEqualTo(packVo.getCreateUser_gte());
}
if(packVo.getCreateUser_lte() != null) {
criteria.andCreateUserLessThanOrEqualTo(packVo.getCreateUser_lte());
}
if(packVo.getStorageId() != null) {
criteria.andStorageIdEqualTo(packVo.getStorageId());
}
if(packVo.getStorageId_arr() != null) {
criteria.andStorageIdIn(packVo.getStorageId_arr());
}
if(packVo.getStorageId_gt() != null) {
criteria.andStorageIdGreaterThan(packVo.getStorageId_gt());
}
if(packVo.getStorageId_lt() != null) {
criteria.andStorageIdLessThan(packVo.getStorageId_lt());
}
if(packVo.getStorageId_gte() != null) {
criteria.andStorageIdGreaterThanOrEqualTo(packVo.getStorageId_gte());
}
if(packVo.getStorageId_lte() != null) {
criteria.andStorageIdLessThanOrEqualTo(packVo.getStorageId_lte());
}
if(packVo.getName() != null) {
criteria.andNameEqualTo(packVo.getName());
}
if(packVo.getName_arr() != null) {
criteria.andNameIn(packVo.getName_arr());
}
if(packVo.getName_like() != null) {
criteria.andNameLike(packVo.getName_like());
}
if(packVo.getStatus() != null) {
criteria.andStatusEqualTo(packVo.getStatus());
}
if(packVo.getStatus_arr() != null) {
criteria.andStatusIn(packVo.getStatus_arr());
}
if(packVo.getStatus_gt() != null) {
criteria.andStatusGreaterThan(packVo.getStatus_gt());
}
if(packVo.getStatus_lt() != null) {
criteria.andStatusLessThan(packVo.getStatus_lt());
}
if(packVo.getStatus_gte() != null) {
criteria.andStatusGreaterThanOrEqualTo(packVo.getStatus_gte());
}
if(packVo.getStatus_lte() != null) {
criteria.andStatusLessThanOrEqualTo(packVo.getStatus_lte());
}
if(packVo.getType() != null) {
criteria.andTypeEqualTo(packVo.getType());
}
if(packVo.getType_arr() != null) {
criteria.andTypeIn(packVo.getType_arr());
}
if(packVo.getType_gt() != null) {
criteria.andTypeGreaterThan(packVo.getType_gt());
}
if(packVo.getType_lt() != null) {
criteria.andTypeLessThan(packVo.getType_lt());
}
if(packVo.getType_gte() != null) {
criteria.andTypeGreaterThanOrEqualTo(packVo.getType_gte());
}
if(packVo.getType_lte() != null) {
criteria.andTypeLessThanOrEqualTo(packVo.getType_lte());
}
return packExample;
}
@Override
protected BaseService<Pack> getService() {
return packService;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.model.PackTag;
import com.viontech.label.platform.model.PackTagExample;
import com.viontech.label.platform.service.adapter.PackTagService;
import com.viontech.label.platform.vo.PackTagVo;
import javax.annotation.Resource;
public abstract class PackTagBaseController extends BaseController<PackTag, PackTagVo> {
@Resource
protected PackTagService packTagService;
@Override
protected BaseExample getExample(PackTagVo packTagVo, int type) {
PackTagExample packTagExample = new PackTagExample();
PackTagExample.Criteria criteria = packTagExample.createCriteria();
if(packTagVo.getId() != null) {
criteria.andIdEqualTo(packTagVo.getId());
}
if(packTagVo.getId_arr() != null) {
criteria.andIdIn(packTagVo.getId_arr());
}
if(packTagVo.getId_gt() != null) {
criteria.andIdGreaterThan(packTagVo.getId_gt());
}
if(packTagVo.getId_lt() != null) {
criteria.andIdLessThan(packTagVo.getId_lt());
}
if(packTagVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(packTagVo.getId_gte());
}
if(packTagVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(packTagVo.getId_lte());
}
if(packTagVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(packTagVo.getCreateTime());
}
if(packTagVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(packTagVo.getCreateTime_arr());
}
if(packTagVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(packTagVo.getCreateTime_gt());
}
if(packTagVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(packTagVo.getCreateTime_lt());
}
if(packTagVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(packTagVo.getCreateTime_gte());
}
if(packTagVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(packTagVo.getCreateTime_lte());
}
if(packTagVo.getPackId() != null) {
criteria.andPackIdEqualTo(packTagVo.getPackId());
}
if(packTagVo.getPackId_arr() != null) {
criteria.andPackIdIn(packTagVo.getPackId_arr());
}
if(packTagVo.getPackId_gt() != null) {
criteria.andPackIdGreaterThan(packTagVo.getPackId_gt());
}
if(packTagVo.getPackId_lt() != null) {
criteria.andPackIdLessThan(packTagVo.getPackId_lt());
}
if(packTagVo.getPackId_gte() != null) {
criteria.andPackIdGreaterThanOrEqualTo(packTagVo.getPackId_gte());
}
if(packTagVo.getPackId_lte() != null) {
criteria.andPackIdLessThanOrEqualTo(packTagVo.getPackId_lte());
}
if(packTagVo.getTag() != null) {
criteria.andTagEqualTo(packTagVo.getTag());
}
if(packTagVo.getTag_arr() != null) {
criteria.andTagIn(packTagVo.getTag_arr());
}
if(packTagVo.getTag_gt() != null) {
criteria.andTagGreaterThan(packTagVo.getTag_gt());
}
if(packTagVo.getTag_lt() != null) {
criteria.andTagLessThan(packTagVo.getTag_lt());
}
if(packTagVo.getTag_gte() != null) {
criteria.andTagGreaterThanOrEqualTo(packTagVo.getTag_gte());
}
if(packTagVo.getTag_lte() != null) {
criteria.andTagLessThanOrEqualTo(packTagVo.getTag_lte());
}
return packTagExample;
}
@Override
protected BaseService<PackTag> getService() {
return packTagService;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.model.Pic;
import com.viontech.label.platform.model.PicExample;
import com.viontech.label.platform.service.adapter.PicService;
import com.viontech.label.platform.vo.PicVo;
import javax.annotation.Resource;
public abstract class PicBaseController extends BaseController<Pic, PicVo> {
@Resource
protected PicService picService;
@Override
protected BaseExample getExample(PicVo picVo, int type) {
PicExample picExample = new PicExample();
PicExample.Criteria criteria = picExample.createCriteria();
if (picVo.getId() != null) {
criteria.andIdEqualTo(picVo.getId());
}
if (picVo.getId_arr() != null) {
criteria.andIdIn(picVo.getId_arr());
}
if (picVo.getId_gt() != null) {
criteria.andIdGreaterThan(picVo.getId_gt());
}
if (picVo.getId_lt() != null) {
criteria.andIdLessThan(picVo.getId_lt());
}
if (picVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(picVo.getId_gte());
}
if (picVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(picVo.getId_lte());
}
if (picVo.getUnid() != null) {
criteria.andUnidEqualTo(picVo.getUnid());
}
if (picVo.getUnid_arr() != null) {
criteria.andUnidIn(picVo.getUnid_arr());
}
if (picVo.getUnid_like() != null) {
criteria.andUnidLike(picVo.getUnid_like());
}
if (picVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(picVo.getCreateTime());
}
if (picVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(picVo.getCreateTime_arr());
}
if (picVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(picVo.getCreateTime_gt());
}
if (picVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(picVo.getCreateTime_lt());
}
if (picVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(picVo.getCreateTime_gte());
}
if (picVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(picVo.getCreateTime_lte());
}
if (picVo.getName() != null) {
criteria.andNameEqualTo(picVo.getName());
}
if (picVo.getName_arr() != null) {
criteria.andNameIn(picVo.getName_arr());
}
if (picVo.getName_like() != null) {
criteria.andNameLike(picVo.getName_like());
}
if (picVo.getStorageId() != null) {
criteria.andStorageIdEqualTo(picVo.getStorageId());
}
if (picVo.getStorageId_arr() != null) {
criteria.andStorageIdIn(picVo.getStorageId_arr());
}
if (picVo.getStorageId_gt() != null) {
criteria.andStorageIdGreaterThan(picVo.getStorageId_gt());
}
if (picVo.getStorageId_lt() != null) {
criteria.andStorageIdLessThan(picVo.getStorageId_lt());
}
if (picVo.getStorageId_gte() != null) {
criteria.andStorageIdGreaterThanOrEqualTo(picVo.getStorageId_gte());
}
if (picVo.getStorageId_lte() != null) {
criteria.andStorageIdLessThanOrEqualTo(picVo.getStorageId_lte());
}
if (picVo.getPackId() != null) {
criteria.andPackIdEqualTo(picVo.getPackId());
}
if (picVo.getPackId_arr() != null) {
criteria.andPackIdIn(picVo.getPackId_arr());
}
if (picVo.getPackId_gt() != null) {
criteria.andPackIdGreaterThan(picVo.getPackId_gt());
}
if (picVo.getPackId_lt() != null) {
criteria.andPackIdLessThan(picVo.getPackId_lt());
}
if (picVo.getPackId_gte() != null) {
criteria.andPackIdGreaterThanOrEqualTo(picVo.getPackId_gte());
}
if (picVo.getPackId_lte() != null) {
criteria.andPackIdLessThanOrEqualTo(picVo.getPackId_lte());
}
if (picVo.getPersonUnid() != null) {
criteria.andPersonUnidEqualTo(picVo.getPersonUnid());
}
if (picVo.getPersonUnid_null() != null) {
if (picVo.getPersonUnid_null().booleanValue()) {
criteria.andPersonUnidIsNull();
} else {
criteria.andPersonUnidIsNotNull();
}
}
if (picVo.getPersonUnid_arr() != null) {
criteria.andPersonUnidIn(picVo.getPersonUnid_arr());
}
if (picVo.getPersonUnid_like() != null) {
criteria.andPersonUnidLike(picVo.getPersonUnid_like());
}
if (picVo.getStatus() != null) {
criteria.andStatusEqualTo(picVo.getStatus());
}
if (picVo.getStatus_arr() != null) {
criteria.andStatusIn(picVo.getStatus_arr());
}
if (picVo.getStatus_gt() != null) {
criteria.andStatusGreaterThan(picVo.getStatus_gt());
}
if (picVo.getStatus_lt() != null) {
criteria.andStatusLessThan(picVo.getStatus_lt());
}
if (picVo.getStatus_gte() != null) {
criteria.andStatusGreaterThanOrEqualTo(picVo.getStatus_gte());
}
if (picVo.getStatus_lte() != null) {
criteria.andStatusLessThanOrEqualTo(picVo.getStatus_lte());
}
return picExample;
}
@Override
protected BaseService<Pic> getService() {
return picService;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.model.Storage;
import com.viontech.label.platform.model.StorageExample;
import com.viontech.label.platform.service.adapter.StorageService;
import com.viontech.label.platform.vo.StorageVo;
import javax.annotation.Resource;
public abstract class StorageBaseController extends BaseController<Storage, StorageVo> {
@Resource
protected StorageService storageService;
@Override
protected BaseExample getExample(StorageVo storageVo, int type) {
StorageExample storageExample = new StorageExample();
StorageExample.Criteria criteria = storageExample.createCriteria();
if(storageVo.getId() != null) {
criteria.andIdEqualTo(storageVo.getId());
}
if(storageVo.getId_arr() != null) {
criteria.andIdIn(storageVo.getId_arr());
}
if(storageVo.getId_gt() != null) {
criteria.andIdGreaterThan(storageVo.getId_gt());
}
if(storageVo.getId_lt() != null) {
criteria.andIdLessThan(storageVo.getId_lt());
}
if(storageVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(storageVo.getId_gte());
}
if(storageVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(storageVo.getId_lte());
}
if(storageVo.getUnid() != null) {
criteria.andUnidEqualTo(storageVo.getUnid());
}
if(storageVo.getUnid_arr() != null) {
criteria.andUnidIn(storageVo.getUnid_arr());
}
if(storageVo.getUnid_like() != null) {
criteria.andUnidLike(storageVo.getUnid_like());
}
if(storageVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(storageVo.getCreateTime());
}
if(storageVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(storageVo.getCreateTime_arr());
}
if(storageVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(storageVo.getCreateTime_gt());
}
if(storageVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(storageVo.getCreateTime_lt());
}
if(storageVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(storageVo.getCreateTime_gte());
}
if(storageVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(storageVo.getCreateTime_lte());
}
if(storageVo.getCreateUser() != null) {
criteria.andCreateUserEqualTo(storageVo.getCreateUser());
}
if(storageVo.getCreateUser_null() != null) {
if(storageVo.getCreateUser_null().booleanValue()) {
criteria.andCreateUserIsNull();
} else {
criteria.andCreateUserIsNotNull();
}
}
if(storageVo.getCreateUser_arr() != null) {
criteria.andCreateUserIn(storageVo.getCreateUser_arr());
}
if(storageVo.getCreateUser_gt() != null) {
criteria.andCreateUserGreaterThan(storageVo.getCreateUser_gt());
}
if(storageVo.getCreateUser_lt() != null) {
criteria.andCreateUserLessThan(storageVo.getCreateUser_lt());
}
if(storageVo.getCreateUser_gte() != null) {
criteria.andCreateUserGreaterThanOrEqualTo(storageVo.getCreateUser_gte());
}
if(storageVo.getCreateUser_lte() != null) {
criteria.andCreateUserLessThanOrEqualTo(storageVo.getCreateUser_lte());
}
if(storageVo.getName() != null) {
criteria.andNameEqualTo(storageVo.getName());
}
if(storageVo.getName_arr() != null) {
criteria.andNameIn(storageVo.getName_arr());
}
if(storageVo.getName_like() != null) {
criteria.andNameLike(storageVo.getName_like());
}
if(storageVo.getType() != null) {
criteria.andTypeEqualTo(storageVo.getType());
}
if(storageVo.getType_arr() != null) {
criteria.andTypeIn(storageVo.getType_arr());
}
if(storageVo.getType_gt() != null) {
criteria.andTypeGreaterThan(storageVo.getType_gt());
}
if(storageVo.getType_lt() != null) {
criteria.andTypeLessThan(storageVo.getType_lt());
}
if(storageVo.getType_gte() != null) {
criteria.andTypeGreaterThanOrEqualTo(storageVo.getType_gte());
}
if(storageVo.getType_lte() != null) {
criteria.andTypeLessThanOrEqualTo(storageVo.getType_lte());
}
if(storageVo.getPath() != null) {
criteria.andPathEqualTo(storageVo.getPath());
}
if(storageVo.getPath_arr() != null) {
criteria.andPathIn(storageVo.getPath_arr());
}
if(storageVo.getPath_like() != null) {
criteria.andPathLike(storageVo.getPath_like());
}
return storageExample;
}
@Override
protected BaseService<Storage> getService() {
return storageService;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.model.TaskPack;
import com.viontech.label.platform.model.TaskPackExample;
import com.viontech.label.platform.service.adapter.TaskPackService;
import com.viontech.label.platform.vo.TaskPackVo;
import javax.annotation.Resource;
public abstract class TaskPackBaseController extends BaseController<TaskPack, TaskPackVo> {
@Resource
protected TaskPackService taskPackService;
@Override
protected BaseExample getExample(TaskPackVo taskPackVo, int type) {
TaskPackExample taskPackExample = new TaskPackExample();
TaskPackExample.Criteria criteria = taskPackExample.createCriteria();
if(taskPackVo.getId() != null) {
criteria.andIdEqualTo(taskPackVo.getId());
}
if(taskPackVo.getId_arr() != null) {
criteria.andIdIn(taskPackVo.getId_arr());
}
if(taskPackVo.getId_gt() != null) {
criteria.andIdGreaterThan(taskPackVo.getId_gt());
}
if(taskPackVo.getId_lt() != null) {
criteria.andIdLessThan(taskPackVo.getId_lt());
}
if(taskPackVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(taskPackVo.getId_gte());
}
if(taskPackVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(taskPackVo.getId_lte());
}
if(taskPackVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(taskPackVo.getCreateTime());
}
if(taskPackVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(taskPackVo.getCreateTime_arr());
}
if(taskPackVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(taskPackVo.getCreateTime_gt());
}
if(taskPackVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(taskPackVo.getCreateTime_lt());
}
if(taskPackVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(taskPackVo.getCreateTime_gte());
}
if(taskPackVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(taskPackVo.getCreateTime_lte());
}
if(taskPackVo.getTaskId() != null) {
criteria.andTaskIdEqualTo(taskPackVo.getTaskId());
}
if(taskPackVo.getTaskId_arr() != null) {
criteria.andTaskIdIn(taskPackVo.getTaskId_arr());
}
if(taskPackVo.getTaskId_gt() != null) {
criteria.andTaskIdGreaterThan(taskPackVo.getTaskId_gt());
}
if(taskPackVo.getTaskId_lt() != null) {
criteria.andTaskIdLessThan(taskPackVo.getTaskId_lt());
}
if(taskPackVo.getTaskId_gte() != null) {
criteria.andTaskIdGreaterThanOrEqualTo(taskPackVo.getTaskId_gte());
}
if(taskPackVo.getTaskId_lte() != null) {
criteria.andTaskIdLessThanOrEqualTo(taskPackVo.getTaskId_lte());
}
if(taskPackVo.getPackId() != null) {
criteria.andPackIdEqualTo(taskPackVo.getPackId());
}
if(taskPackVo.getPackId_arr() != null) {
criteria.andPackIdIn(taskPackVo.getPackId_arr());
}
if(taskPackVo.getPackId_gt() != null) {
criteria.andPackIdGreaterThan(taskPackVo.getPackId_gt());
}
if(taskPackVo.getPackId_lt() != null) {
criteria.andPackIdLessThan(taskPackVo.getPackId_lt());
}
if(taskPackVo.getPackId_gte() != null) {
criteria.andPackIdGreaterThanOrEqualTo(taskPackVo.getPackId_gte());
}
if(taskPackVo.getPackId_lte() != null) {
criteria.andPackIdLessThanOrEqualTo(taskPackVo.getPackId_lte());
}
return taskPackExample;
}
@Override
protected BaseService<TaskPack> getService() {
return taskPackService;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.model.User;
import com.viontech.label.platform.model.UserExample;
import com.viontech.label.platform.service.adapter.UserService;
import com.viontech.label.platform.vo.UserVo;
import javax.annotation.Resource;
public abstract class UserBaseController extends BaseController<User, UserVo> {
@Resource
protected UserService userService;
@Override
protected BaseExample getExample(UserVo userVo, int type) {
UserExample userExample = new UserExample();
UserExample.Criteria criteria = userExample.createCriteria();
if(userVo.getId() != null) {
criteria.andIdEqualTo(userVo.getId());
}
if(userVo.getId_arr() != null) {
criteria.andIdIn(userVo.getId_arr());
}
if(userVo.getId_gt() != null) {
criteria.andIdGreaterThan(userVo.getId_gt());
}
if(userVo.getId_lt() != null) {
criteria.andIdLessThan(userVo.getId_lt());
}
if(userVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(userVo.getId_gte());
}
if(userVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(userVo.getId_lte());
}
if(userVo.getUnid() != null) {
criteria.andUnidEqualTo(userVo.getUnid());
}
if(userVo.getUnid_arr() != null) {
criteria.andUnidIn(userVo.getUnid_arr());
}
if(userVo.getUnid_like() != null) {
criteria.andUnidLike(userVo.getUnid_like());
}
if(userVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(userVo.getCreateTime());
}
if(userVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(userVo.getCreateTime_arr());
}
if(userVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(userVo.getCreateTime_gt());
}
if(userVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(userVo.getCreateTime_lt());
}
if(userVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(userVo.getCreateTime_gte());
}
if(userVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(userVo.getCreateTime_lte());
}
if(userVo.getCreateUser() != null) {
criteria.andCreateUserEqualTo(userVo.getCreateUser());
}
if(userVo.getCreateUser_null() != null) {
if(userVo.getCreateUser_null().booleanValue()) {
criteria.andCreateUserIsNull();
} else {
criteria.andCreateUserIsNotNull();
}
}
if(userVo.getCreateUser_arr() != null) {
criteria.andCreateUserIn(userVo.getCreateUser_arr());
}
if(userVo.getCreateUser_gt() != null) {
criteria.andCreateUserGreaterThan(userVo.getCreateUser_gt());
}
if(userVo.getCreateUser_lt() != null) {
criteria.andCreateUserLessThan(userVo.getCreateUser_lt());
}
if(userVo.getCreateUser_gte() != null) {
criteria.andCreateUserGreaterThanOrEqualTo(userVo.getCreateUser_gte());
}
if(userVo.getCreateUser_lte() != null) {
criteria.andCreateUserLessThanOrEqualTo(userVo.getCreateUser_lte());
}
if(userVo.getUsername() != null) {
criteria.andUsernameEqualTo(userVo.getUsername());
}
if(userVo.getUsername_arr() != null) {
criteria.andUsernameIn(userVo.getUsername_arr());
}
if(userVo.getUsername_like() != null) {
criteria.andUsernameLike(userVo.getUsername_like());
}
if(userVo.getPassword() != null) {
criteria.andPasswordEqualTo(userVo.getPassword());
}
if(userVo.getPassword_arr() != null) {
criteria.andPasswordIn(userVo.getPassword_arr());
}
if(userVo.getPassword_like() != null) {
criteria.andPasswordLike(userVo.getPassword_like());
}
if(userVo.getType() != null) {
criteria.andTypeEqualTo(userVo.getType());
}
if(userVo.getType_arr() != null) {
criteria.andTypeIn(userVo.getType_arr());
}
if(userVo.getType_gt() != null) {
criteria.andTypeGreaterThan(userVo.getType_gt());
}
if(userVo.getType_lt() != null) {
criteria.andTypeLessThan(userVo.getType_lt());
}
if(userVo.getType_gte() != null) {
criteria.andTypeGreaterThanOrEqualTo(userVo.getType_gte());
}
if(userVo.getType_lte() != null) {
criteria.andTypeLessThanOrEqualTo(userVo.getType_lte());
}
if(userVo.getName() != null) {
criteria.andNameEqualTo(userVo.getName());
}
if(userVo.getName_null() != null) {
if(userVo.getName_null().booleanValue()) {
criteria.andNameIsNull();
} else {
criteria.andNameIsNotNull();
}
}
if(userVo.getName_arr() != null) {
criteria.andNameIn(userVo.getName_arr());
}
if(userVo.getName_like() != null) {
criteria.andNameLike(userVo.getName_like());
}
if(userVo.getMail() != null) {
criteria.andMailEqualTo(userVo.getMail());
}
if(userVo.getMail_null() != null) {
if(userVo.getMail_null().booleanValue()) {
criteria.andMailIsNull();
} else {
criteria.andMailIsNotNull();
}
}
if(userVo.getMail_arr() != null) {
criteria.andMailIn(userVo.getMail_arr());
}
if(userVo.getMail_like() != null) {
criteria.andMailLike(userVo.getMail_like());
}
if(userVo.getTel() != null) {
criteria.andTelEqualTo(userVo.getTel());
}
if(userVo.getTel_null() != null) {
if(userVo.getTel_null().booleanValue()) {
criteria.andTelIsNull();
} else {
criteria.andTelIsNotNull();
}
}
if(userVo.getTel_arr() != null) {
criteria.andTelIn(userVo.getTel_arr());
}
if(userVo.getTel_like() != null) {
criteria.andTelLike(userVo.getTel_like());
}
if(userVo.getAccountId() != null) {
criteria.andAccountIdEqualTo(userVo.getAccountId());
}
if(userVo.getAccountId_null() != null) {
if(userVo.getAccountId_null().booleanValue()) {
criteria.andAccountIdIsNull();
} else {
criteria.andAccountIdIsNotNull();
}
}
if(userVo.getAccountId_arr() != null) {
criteria.andAccountIdIn(userVo.getAccountId_arr());
}
if(userVo.getAccountId_gt() != null) {
criteria.andAccountIdGreaterThan(userVo.getAccountId_gt());
}
if(userVo.getAccountId_lt() != null) {
criteria.andAccountIdLessThan(userVo.getAccountId_lt());
}
if(userVo.getAccountId_gte() != null) {
criteria.andAccountIdGreaterThanOrEqualTo(userVo.getAccountId_gte());
}
if(userVo.getAccountId_lte() != null) {
criteria.andAccountIdLessThanOrEqualTo(userVo.getAccountId_lte());
}
if(userVo.getLastLoginTime() != null) {
criteria.andLastLoginTimeEqualTo(userVo.getLastLoginTime());
}
if(userVo.getLastLoginTime_null() != null) {
if(userVo.getLastLoginTime_null().booleanValue()) {
criteria.andLastLoginTimeIsNull();
} else {
criteria.andLastLoginTimeIsNotNull();
}
}
if(userVo.getLastLoginTime_arr() != null) {
criteria.andLastLoginTimeIn(userVo.getLastLoginTime_arr());
}
if(userVo.getLastLoginTime_gt() != null) {
criteria.andLastLoginTimeGreaterThan(userVo.getLastLoginTime_gt());
}
if(userVo.getLastLoginTime_lt() != null) {
criteria.andLastLoginTimeLessThan(userVo.getLastLoginTime_lt());
}
if(userVo.getLastLoginTime_gte() != null) {
criteria.andLastLoginTimeGreaterThanOrEqualTo(userVo.getLastLoginTime_gte());
}
if(userVo.getLastLoginTime_lte() != null) {
criteria.andLastLoginTimeLessThanOrEqualTo(userVo.getLastLoginTime_lte());
}
return userExample;
}
@Override
protected BaseService<User> getService() {
return userService;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.AccountBaseController;
import com.viontech.label.platform.model.AccountExample;
import com.viontech.label.platform.vo.AccountVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/accounts")
public class AccountController extends AccountBaseController {
@Override
protected BaseExample getExample(AccountVo accountVo, int type) {
AccountExample accountExample = (AccountExample)super.getExample(accountVo,type);
return accountExample;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.DictBaseController;
import com.viontech.label.platform.model.DictExample;
import com.viontech.label.platform.vo.DictVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/dicts")
public class DictController extends DictBaseController {
@Override
protected BaseExample getExample(DictVo dictVo, int type) {
DictExample dictExample = (DictExample)super.getExample(dictVo,type);
return dictExample;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.LogBaseController;
import com.viontech.label.platform.model.LogExample;
import com.viontech.label.platform.vo.LogVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/logs")
public class LogController extends LogBaseController {
@Override
protected BaseExample getExample(LogVo logVo, int type) {
LogExample logExample = (LogExample)super.getExample(logVo,type);
return logExample;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.PackBaseController;
import com.viontech.label.platform.model.PackExample;
import com.viontech.label.platform.vo.PackVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/packs")
public class PackController extends PackBaseController {
@Override
protected BaseExample getExample(PackVo packVo, int type) {
PackExample packExample = (PackExample)super.getExample(packVo,type);
packExample.createColumns();
packExample.createStorageColumns();
return packExample;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.PackTagBaseController;
import com.viontech.label.platform.model.PackTagExample;
import com.viontech.label.platform.vo.PackTagVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/packTags")
public class PackTagController extends PackTagBaseController {
@Override
protected BaseExample getExample(PackTagVo packTagVo, int type) {
PackTagExample packTagExample = (PackTagExample)super.getExample(packTagVo,type);
return packTagExample;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import com.viontech.keliu.util.JsonMessageUtil;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.PicBaseController;
import com.viontech.label.platform.model.PicExample;
import com.viontech.label.platform.utils.StorageUtils;
import com.viontech.label.platform.vo.PicVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@Controller
@RequestMapping("/pics")
@Slf4j
public class PicController extends PicBaseController {
@Resource
private StorageUtils storageUtils;
@Override
protected BaseExample getExample(PicVo picVo, int type) {
PicExample picExample = (PicExample) super.getExample(picVo, type);
picExample.createColumns();
picExample.createPackColumns();
picExample.createStorageColumns();
return picExample;
}
@Override
@RequestMapping(value = "", method = RequestMethod.POST)
@ResponseBody
public Object add(PicVo picVo) {
MultipartFile file = picVo.getFile();
String originalFilename = file.getOriginalFilename();
picVo.setName(originalFilename);
try {
byte[] bytes = file.getBytes();
storageUtils.setPic(picVo, bytes);
} catch (Exception e) {
log.info("", e);
return JsonMessageUtil.getErrorJsonMsg(e.getMessage());
}
return super.add(picVo);
}
@GetMapping("/image/{picId}")
@ResponseBody
public void getImage(@PathVariable("picId") Long picId, HttpServletResponse response) throws Exception {
PicVo pic = storageUtils.getPic(picId);
if (pic == null) {
return;
}
String contentType;
String suffix = pic.getName().substring(pic.getName().lastIndexOf(".") + 1).toLowerCase();
switch (suffix) {
case "jpg":
case "jpeg":
default:
contentType = MediaType.IMAGE_JPEG_VALUE;
break;
case "png":
contentType = MediaType.IMAGE_PNG_VALUE;
break;
case "gif":
contentType = MediaType.IMAGE_GIF_VALUE;
break;
}
response.setContentType(contentType);
IOUtils.copy(new ByteArrayInputStream(pic.getImage()), response.getOutputStream());
}
@Override
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ResponseBody
public Object del(@PathVariable(value = "id") Long id) {
try {
storageUtils.deletePic(id);
} catch (Exception e) {
return JsonMessageUtil.getErrorJsonMsg(e.getMessage());
}
return super.del(id);
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import com.github.pagehelper.PageInfo;
import com.viontech.keliu.util.JsonMessageUtil;
import com.viontech.label.platform.mapper.PicMapper;
import com.viontech.label.platform.model.Pic;
import com.viontech.label.platform.service.adapter.PicService;
import com.viontech.label.platform.service.main.ReidService;
import com.viontech.label.platform.vo.ReidUploadData;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.*;
/**
* .
*
* @author 谢明辉
* @date 2021/6/18
*/
@RestController
@RequestMapping("/reid")
public class ReidController {
@Resource
private PicService picService;
@Resource
private ReidService reidService;
@PostMapping("/upload")
public Object upload(ReidUploadData uploadData) throws Exception {
reidService.savePicAndFeature(uploadData);
return JsonMessageUtil.getSuccessJsonMsg("success");
}
/**
* 获取人员列表
*
* @param packId 图包Id
*/
@GetMapping("/getPeople")
public Object getPeople(@RequestParam Long packId, @RequestParam(required = false) Integer status
, @RequestParam(required = false) Long page, @RequestParam(required = false) Long size) {
PicMapper mapper = (PicMapper) picService.getMapper();
List<Pic> people = mapper.getPeople(packId, status, page == null ? null : (page - 1) * size, size);
LinkedHashMap<String, List<Pic>> temp = new LinkedHashMap<>();
for (Pic pic : people) {
List<Pic> list = temp.computeIfAbsent(pic.getPersonUnid(), x -> new LinkedList<>());
list.add(pic);
}
if (page != null) {
PageInfo<Object> pageInfo = new PageInfo<>(new ArrayList<>(temp.entrySet()), page.intValue());
pageInfo.setTotal(mapper.countPeople(packId, status));
return JsonMessageUtil.getSuccessJsonMsg(pageInfo);
} else {
return JsonMessageUtil.getSuccessJsonMsg(temp);
}
}
@GetMapping("/getOtherPeople")
public Object getNextPeoPle(@RequestParam String personUnid, @RequestParam Long packId, @RequestParam(required = false) Integer status, @RequestParam Integer type) {
PicMapper mapper = (PicMapper) picService.getMapper();
List<Pic> pics = mapper.getOtherPeople(packId, status, personUnid, type == 0 ? ">" : "<", type == 0 ? "" : "desc");
if (pics.size() == 0) {
return JsonMessageUtil.getSuccessJsonMsg("没有数据了");
}
String pun = pics.get(0).getPersonUnid();
HashMap<String, List<Pic>> result = new HashMap<>(1);
result.put(pun, pics);
return JsonMessageUtil.getSuccessJsonMsg(result);
}
/**
* 合并多张图片为同一个人
*
* @param picIdArr 待合并的图片id集合
* @param packId 图包id
*/
@GetMapping("/mergeAsNewPerson")
public Object mergeAsNewPerson(@RequestParam Long[] picIdArr, @RequestParam Long packId) {
try {
reidService.mergeAsNewPerson(picIdArr, packId);
return JsonMessageUtil.getSuccessJsonMsg("success");
} catch (Exception e) {
return JsonMessageUtil.getErrorJsonMsg(e.getMessage());
}
}
/**
* 将图片合并到某个人下
*
* @param picIdArr 待合并的图片id集合
* @param personUnid 目标人员的personUnid
* @param packId 图包id
*/
@GetMapping("/mergeTo")
public Object mergeTo(@RequestParam Long[] picIdArr, @RequestParam String personUnid, @RequestParam String currentPerson, @RequestParam Long packId) {
if (picIdArr.length <= 0 || personUnid == null) {
return JsonMessageUtil.getErrorJsonMsg("参数错误");
}
try {
reidService.mergeTo(picIdArr, personUnid, currentPerson, packId);
return JsonMessageUtil.getSuccessJsonMsg("success");
} catch (Exception e) {
return JsonMessageUtil.getErrorJsonMsg(e.getMessage());
}
}
/**
* 合并多个人为同一个人
*
* @param personUnidArr 多个人的personUnid集合
* @param packId 图包id
*/
@GetMapping("/mergePerson")
public Object mergePerson(@RequestParam String[] personUnidArr, @RequestParam String currentPerson, @RequestParam Long packId) {
if (personUnidArr.length <= 1) {
return JsonMessageUtil.getSuccessJsonMsg("所选项过少");
}
try {
reidService.mergePerson(personUnidArr, currentPerson, packId);
return JsonMessageUtil.getSuccessJsonMsg("success");
} catch (Exception e) {
return JsonMessageUtil.getErrorJsonMsg(e.getMessage());
}
}
/**
* 标记某个人已经被清理干净了
*
* @param personUnid 人的personUnid
* @param packId 图包id
*/
@GetMapping("/setPure")
public Object setPackPure(@RequestParam String personUnid, @RequestParam Long packId) {
reidService.setPackPure(personUnid, packId);
return JsonMessageUtil.getSuccessJsonMsg("success");
}
/**
* 根据图片查找相似的人
*
* @param picIdArr 图片Id数组
* @param packId 图包id
* @param size 获取相似的人的数量
*/
@GetMapping("/getSimilarPerson")
public Object getSimilarPerson(@RequestParam Long[] picIdArr, @RequestParam Long packId, @RequestParam Long size, @RequestParam Integer timeInterval) {
Map<String, List<Pic>> similarPerson = reidService.getSimilarPerson(picIdArr, packId, size,timeInterval);
return JsonMessageUtil.getSuccessJsonMsg("success", similarPerson);
}
/**
* 完全删除图片
*
* @param picIdArr 需要删除的图片的id集合
* @param packId 图包id
*/
@DeleteMapping("/deletePic")
public Object deletePic(@RequestParam Long[] picIdArr, @RequestParam Long packId) {
reidService.deletePic(picIdArr, packId);
return JsonMessageUtil.getSuccessJsonMsg("success");
}
/**
* 标记为标注中
*/
@GetMapping("/labeling")
public Object labeling(@RequestParam String personUnid, @RequestParam Long packId) {
boolean success = reidService.labeling(personUnid, packId);
if (success) {
return JsonMessageUtil.getSuccessJsonMsg("success");
} else {
return JsonMessageUtil.getErrorJsonMsg("正在被其他人标注");
}
}
/**
* 退出标注
*/
@GetMapping("exitLabeling")
public Object exitLabeling(@RequestParam String personUnid, @RequestParam Long packId) {
reidService.exitLabeling(personUnid, packId);
return JsonMessageUtil.getSuccessJsonMsg("success");
}
}
package com.viontech.label.platform.controller.web;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.StorageBaseController;
import com.viontech.label.platform.model.StorageExample;
import com.viontech.label.platform.vo.StorageVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/storages")
public class StorageController extends StorageBaseController {
@Override
protected BaseExample getExample(StorageVo storageVo, int type) {
StorageExample storageExample = (StorageExample)super.getExample(storageVo,type);
return storageExample;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.SubTaskBaseController;
import com.viontech.label.platform.model.SubTaskExample;
import com.viontech.label.platform.vo.SubTaskVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/subTasks")
public class SubTaskController extends SubTaskBaseController {
@Override
protected BaseExample getExample(SubTaskVo subTaskVo, int type) {
SubTaskExample subTaskExample = (SubTaskExample) super.getExample(subTaskVo, type);
return subTaskExample;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import cn.dev33.satoken.stp.StpUtil;
import com.github.pagehelper.PageInfo;
import com.viontech.keliu.util.JsonMessageUtil;
import com.viontech.label.core.constant.Constants;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.TaskBaseController;
import com.viontech.label.platform.mapper.SubTaskMapper;
import com.viontech.label.platform.model.*;
import com.viontech.label.platform.service.adapter.*;
import com.viontech.label.platform.vo.TaskVo;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.viontech.keliu.util.JsonMessageUtil.getSuccessJsonMsg;
@Controller
@RequestMapping("/tasks")
public class TaskController extends TaskBaseController {
@Resource
private SubTaskService subTaskService;
@Resource
private UserService userService;
@Resource
private TaskPackService taskPackService;
@Resource
private PackService packService;
@Override
protected BaseExample getExample(TaskVo taskVo, int type) {
TaskExample taskExample = (TaskExample) super.getExample(taskVo, type);
taskExample.createAccountColumns();
taskExample.createColumns();
return taskExample;
}
@Override
@RequestMapping(value = "", method = RequestMethod.POST)
@ResponseBody
public Object add(@RequestBody TaskVo taskVo) {
long loginId = StpUtil.getLoginIdAsLong();
taskVo.setCreateUser(loginId);
List<Long> packIds = taskVo.getPackIds();
TaskService service = (TaskService) getService();
Task task = service.addTaskWithPack(taskVo, packIds);
return JsonMessageUtil.getSuccessJsonMsg(task);
}
@Override
@RequestMapping(value = "", method = RequestMethod.GET)
@ResponseBody
public Object page(TaskVo taskVo, @RequestParam(value = "page", defaultValue = "-1") int page, @RequestParam(value = "pageSize", defaultValue = "100") int pageSize, String sortName, String sortOrder) {
BaseExample baseExample = getExample(taskVo, EXAMPLE_TYPE_PAGE);
if (isNotNull(sortOrder) && isNotNull(sortName)) {
baseExample.setOrderByClause(baseExample.getTableAlias() + "." + sortName + " " + sortOrder);
} else if (isNotNull(sortName) && !isNotNull(sortOrder)) {
baseExample.setOrderByClause(sortName);
}
List<Task> result;
PageInfo<Task> pageInfo = null;
if (page <= 0) {
result = taskService.selectByExample(baseExample);
} else {
pageInfo = taskService.pagedQuery(baseExample, page, pageSize);
result = pageInfo.getList();
}
List<Long> taskIds = result.stream().map(Task::getId).collect(Collectors.toList());
TaskPackExample taskPackExample = new TaskPackExample();
taskPackExample.createPackColumns();
taskPackExample.createColumns();
taskPackExample.createCriteria().andTaskIdIn(taskIds);
List<TaskPack> taskPacks = taskPackService.selectByExample(taskPackExample);
Map<Long, List<Pack>> task_packs_map = taskPacks.stream().collect(Collectors.groupingBy(TaskPack::getTaskId, Collectors.mapping(TaskPack::getPack, Collectors.toList())));
for (Task task : result) {
List<Pack> packs = task_packs_map.get(task.getId());
task.setPacks(packs);
}
if (page <= 0) {
return getSuccessJsonMsg(MESSAGE_SELECT_SUCCESS, result);
} else {
return getSuccessJsonMsg(MESSAGE_PAGE_SUCCESS, pageInfo);
}
}
@GetMapping("/equallyAssign")
@ResponseBody
@Transactional(rollbackFor = Exception.class)
public Object equallyAssign(TaskVo taskVo) {
Long taskId = taskVo.getId();
Long accountId = taskVo.getAccountId();
UserExample userExample = new UserExample();
userExample.createCriteria().andAccountIdEqualTo(accountId);
List<User> users = userService.selectByExample(userExample);
Map<Integer, List<Long>> userType2IdListMap = users.stream().collect(Collectors.groupingBy(User::getType, Collectors.mapping(User::getId, Collectors.toList())));
List<Long> annotatorUserIds = userType2IdListMap.get(Constants.USER_TYPE_ANNOTATOR);
int annotatorNum = annotatorUserIds.size();
if (annotatorNum > 0) {
int total = subTaskService.countSubtasksOfUnassignedAnnotators(taskId);
int count = total / annotatorNum;
int remainder = total % annotatorNum;
for (Long annotatorUserId : annotatorUserIds) {
// 如果有余数并且大于0说明没分配完,此时需要多分一个
int countTemp = remainder-- > 0 ? ++count : count;
if (countTemp == 0) {
break;
}
subTaskService.assignAnnotators(taskId, annotatorUserId, countTemp);
}
}
List<Long> outInspectorIds = userType2IdListMap.get(Constants.USER_TYPE_OUT_INSPECTOR);
int outInspectorNum = outInspectorIds.size();
if (outInspectorNum > 0) {
int total = subTaskService.countSubtasksOfUnassignedOutInspectors(taskId);
int count = total / outInspectorNum;
int remainder = total % outInspectorNum;
for (Long outInspectorId : outInspectorIds) {
// 如果有余数并且大于0说明没分配完,此时需要多分一个
int countTemp = remainder-- > 0 ? ++count : count;
if (countTemp == 0) {
break;
}
subTaskService.assignOutInspector(taskId, outInspectorId, countTemp);
}
}
return JsonMessageUtil.getSuccessJsonMsg("success");
}
@GetMapping("/assign")
@ResponseBody
@Transactional(rollbackFor = Exception.class)
public Object assign(@RequestParam Long annotatorId, @RequestParam Long outInspectorId, @RequestParam("id") Long taskId, @RequestParam Long count) {
SubTaskMapper mapper = (SubTaskMapper) subTaskService.getMapper();
mapper.assignAnnotatorAndOutInspector(taskId, annotatorId, outInspectorId, count);
return JsonMessageUtil.getSuccessJsonMsg("success");
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.TaskPackBaseController;
import com.viontech.label.platform.model.TaskPackExample;
import com.viontech.label.platform.vo.TaskPackVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/taskPacks")
public class TaskPackController extends TaskPackBaseController {
@Override
protected BaseExample getExample(TaskPackVo taskPackVo, int type) {
TaskPackExample taskPackExample = (TaskPackExample)super.getExample(taskPackVo,type);
return taskPackExample;
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.controller.web;
import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil;
import com.viontech.keliu.util.JsonMessageUtil;
import com.viontech.keliu.util.JsonMessageUtil.JsonMessage;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.UserBaseController;
import com.viontech.label.platform.model.User;
import com.viontech.label.platform.model.UserExample;
import com.viontech.label.platform.vo.UserVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import static com.viontech.keliu.util.JsonMessageUtil.getSuccessJsonMsg;
@Controller
@RequestMapping("/users")
public class UserController extends UserBaseController {
@Override
protected BaseExample getExample(UserVo userVo, int type) {
UserExample example = (UserExample) super.getExample(userVo, type);
example.createColumns().hasCreateTimeColumn().hasCreateUserColumn().hasIdColumn().hasAccountIdColumn().hasLastLoginTimeColumn().hasNameColumn()
.hasUsernameColumn().hasTelColumn().hasMailColumn().hasTypeColumn().hasUnidColumn();
return example;
}
@PostMapping("/login")
@ResponseBody
public JsonMessage<User> login(@RequestBody UserVo loginUser) {
String username = loginUser.getUsername();
String password = loginUser.getPassword();
UserExample userExample = new UserExample();
userExample.createCriteria().andUsernameEqualTo(username);
List<User> users = getService().selectByExample(userExample);
if (users.size() > 0) {
User user = users.get(0);
String passwordInDb = user.getPassword();
user.setPassword(null);
if (password.equals(passwordInDb)) {
StpUtil.setLoginId(user.getId());
UserVo userVo = new UserVo();
userVo.setLastLoginTime(new Date());
SaTokenInfo tokenInfo = StpUtil.getTokenInfo();
update(user.getId(), userVo);
userVo.setModel(user);
userVo.setTokenInfo(tokenInfo);
return JsonMessageUtil.getSuccessJsonMsg("success", userVo);
} else {
return JsonMessageUtil.getErrorJsonMsg("error password");
}
} else {
return JsonMessageUtil.getErrorJsonMsg("no such user");
}
}
@RequestMapping(value = "", method = RequestMethod.POST)
@ResponseBody
@Override
public Object add(@RequestBody UserVo userVo) {
try {
long loginId = StpUtil.getLoginIdAsLong();
if (loginId != userVo.getCreateUser()) {
userVo.setCreateUser(loginId);
}
return JsonMessageUtil.getSuccessJsonMsg(userService.addUser(userVo));
} catch (Exception e) {
return JsonMessageUtil.getErrorJsonMsg(e.getMessage());
}
}
@Override
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ResponseBody
public Object selOne(@PathVariable(value = "id") Long id) {
User user = userService.selectByPrimaryKey(id);
user.setPassword(null);
return getSuccessJsonMsg(MESSAGE_LIST_SUCCESS, user);
}
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.interceptor;
import cn.dev33.satoken.exception.NotLoginException;
import cn.dev33.satoken.stp.StpUtil;
import com.viontech.label.platform.model.User;
import com.viontech.label.platform.service.adapter.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* .
*
* @author 谢明辉
* @date 2021/5/26
*/
@Component
@Slf4j
public class AuthInterceptor extends HandlerInterceptorAdapter {
@Resource
private UserService userService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
request.setAttribute("request_start", System.currentTimeMillis());
if (!StpUtil.isLogin()) {
throw NotLoginException.newInstance("", null);
}
StpUtil.checkLogin();
long loginId = StpUtil.getLoginIdAsLong();
User user = userService.selectByPrimaryKey(loginId);
request.setAttribute("user", user);
request.setAttribute("userId", user.getId());
request.setAttribute("accountId", user.getAccountId());
return true;
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
Object o = request.getAttribute("request_start");
if (o != null) {
Long requestStart = (Long) o;
String queryString = request.getQueryString();
String uri = request.getRequestURL().toString();
String path = queryString == null ? uri : uri + "?" + queryString;
User user = (User) request.getAttribute("user");
log.info("\n用户名:[{}]\n请求信息:[{}]\n请求方式:[{}]\n处理时长:[{}]\n", user.getUsername(), path, request.getMethod(), System.currentTimeMillis() - requestStart);
}
super.afterCompletion(request, response, handler, ex);
}
}
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.Account;
import com.viontech.label.platform.model.AccountExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface AccountMapper extends BaseMapper {
int countByExample(AccountExample example);
int deleteByExample(AccountExample example);
int deleteByPrimaryKey(Long id);
int insert(Account record);
int insertSelective(Account record);
List<Account> selectByExample(AccountExample example);
Account selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Account record, @Param("example") AccountExample example);
int updateByExample(@Param("record") Account record, @Param("example") AccountExample example);
int updateByPrimaryKeySelective(Account record);
int updateByPrimaryKey(Account record);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.Dict;
import com.viontech.label.platform.model.DictExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DictMapper extends BaseMapper {
int countByExample(DictExample example);
int deleteByExample(DictExample example);
int deleteByPrimaryKey(Long id);
int insert(Dict record);
int insertSelective(Dict record);
List<Dict> selectByExample(DictExample example);
Dict selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Dict record, @Param("example") DictExample example);
int updateByExample(@Param("record") Dict record, @Param("example") DictExample example);
int updateByPrimaryKeySelective(Dict record);
int updateByPrimaryKey(Dict record);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.Log;
import com.viontech.label.platform.model.LogExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface LogMapper extends BaseMapper {
int countByExample(LogExample example);
int deleteByExample(LogExample example);
int deleteByPrimaryKey(Long id);
int insert(Log record);
int insertSelective(Log record);
List<Log> selectByExample(LogExample example);
Log selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Log record, @Param("example") LogExample example);
int updateByExample(@Param("record") Log record, @Param("example") LogExample example);
int updateByPrimaryKeySelective(Log record);
int updateByPrimaryKey(Log record);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.Pack;
import com.viontech.label.platform.model.PackExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PackMapper extends BaseMapper {
int countByExample(PackExample example);
int deleteByExample(PackExample example);
int deleteByPrimaryKey(Long id);
int insert(Pack record);
int insertSelective(Pack record);
List<Pack> selectByExample(PackExample example);
Pack selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Pack record, @Param("example") PackExample example);
int updateByExample(@Param("record") Pack record, @Param("example") PackExample example);
int updateByPrimaryKeySelective(Pack record);
int updateByPrimaryKey(Pack record);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.PackTag;
import com.viontech.label.platform.model.PackTagExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PackTagMapper extends BaseMapper {
int countByExample(PackTagExample example);
int deleteByExample(PackTagExample example);
int deleteByPrimaryKey(Long id);
int insert(PackTag record);
int insertSelective(PackTag record);
List<PackTag> selectByExample(PackTagExample example);
PackTag selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") PackTag record, @Param("example") PackTagExample example);
int updateByExample(@Param("record") PackTag record, @Param("example") PackTagExample example);
int updateByPrimaryKeySelective(PackTag record);
int updateByPrimaryKey(PackTag record);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.Pic;
import com.viontech.label.platform.model.PicExample;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
public interface PicMapper extends BaseMapper {
int countByExample(PicExample example);
int deleteByExample(PicExample example);
int deleteByPrimaryKey(Long id);
int insert(Pic record);
int insertSelective(Pic record);
List<Pic> selectByExample(PicExample example);
Pic selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Pic record, @Param("example") PicExample example);
int updateByExample(@Param("record") Pic record, @Param("example") PicExample example);
int updateByPrimaryKeySelective(Pic record);
int updateByPrimaryKey(Pic record);
@Insert("insert into d_sub_task(create_user,pic_id,task_id,in_inspector_id) select #{createUserId},id,#{taskId},#{inInspectorId} from d_pic where pack_id=#{packId}")
void createTasks(Long createUserId, Long taskId, Long packId, Long inInspectorId);
@Update("update d_pic set person_unid = #{personUnid},status=(select status from d_pic where person_unid = #{personUnid} limit 1) where id = #{id}")
void mergeTo(Long id, String personUnid);
@Select("<script>" +
"select id,unid,create_time as createTime,name,storage_id as storageId,pack_id as packId,person_unid as personUnid,status from d_pic where pack_id=#{packId} and person_unid in " +
"(select person_unid from d_pic where pack_id=#{packId}" +
" <if test = 'status != null'> and status=#{status}</if> group by person_unid having count(*) > 1 order by person_unid <if test='offset != null'> offset #{offset} limit #{limit}</if>) " +
" order by person_unid </script>")
List<Pic> getPeople(Long packId, Integer status, Long offset, Long limit);
@Select("<script>" +
"select count(*) from " +
"(select person_unid from d_pic where pack_id=#{packId}" +
" <if test = 'status != null'> and status=#{status}</if> group by person_unid having count(*) > 1) as t " +
"</script>")
int countPeople(Long packId, Integer status);
@Select("<script>" +
"select id,unid,create_time as createTime,name,storage_id as storageId,pack_id as packId,person_unid as personUnid,status from d_pic where pack_id=#{packId} and person_unid=" +
"(select person_unid from d_pic where pack_id=#{packId} <if test = 'status != null'> and status=#{status}</if> and person_unid ${type} #{personUnid} group by person_unid having count(*) > 1 order by person_unid ${sort} limit 1) order by id" +
"</script>")
List<Pic> getOtherPeople(Long packId, Integer status, String personUnid, String type,String sort);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.Storage;
import com.viontech.label.platform.model.StorageExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface StorageMapper extends BaseMapper {
int countByExample(StorageExample example);
int deleteByExample(StorageExample example);
int deleteByPrimaryKey(Long id);
int insert(Storage record);
int insertSelective(Storage record);
List<Storage> selectByExample(StorageExample example);
Storage selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Storage record, @Param("example") StorageExample example);
int updateByExample(@Param("record") Storage record, @Param("example") StorageExample example);
int updateByPrimaryKeySelective(Storage record);
int updateByPrimaryKey(Storage record);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.SubTask;
import com.viontech.label.platform.model.SubTaskExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import java.util.List;
public interface SubTaskMapper extends BaseMapper {
int countByExample(SubTaskExample example);
int deleteByExample(SubTaskExample example);
int deleteByPrimaryKey(Long id);
int insert(SubTask record);
int insertSelective(SubTask record);
List<SubTask> selectByExample(SubTaskExample example);
SubTask selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SubTask record, @Param("example") SubTaskExample example);
int updateByExample(@Param("record") SubTask record, @Param("example") SubTaskExample example);
int updateByPrimaryKeySelective(SubTask record);
int updateByPrimaryKey(SubTask record);
@Update("update d_sub_task set annotator_id = #{annotatorId} where id in (select id from d_sub_task where task_id= #{taskId} and annotator_id is null order by id OFFSET 0 limit #{count} )")
void assignAnnotators(long taskId, long annotatorId, long count);
@Update("update d_sub_task set out_inspector_id = #{outInspectorId} where id in (select id from d_sub_task where task_id= #{taskId} and out_inspector_id is null order by id OFFSET 0 limit #{count} )")
void assignOutInspector(long taskId, long outInspectorId, long count);
@Update("update d_sub_task set out_inspector_id = #{outInspectorId},annotator_id = #{annotatorId} where id in (select id from d_sub_task where task_id= #{taskId} and out_inspector_id is null and annotator_id is null order by id OFFSET 0 limit #{count} )")
void assignAnnotatorAndOutInspector(long taskId, long annotatorId, long outInspectorId, long count);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.Task;
import com.viontech.label.platform.model.TaskExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TaskMapper extends BaseMapper {
int countByExample(TaskExample example);
int deleteByExample(TaskExample example);
int deleteByPrimaryKey(Long id);
int insert(Task record);
int insertSelective(Task record);
List<Task> selectByExample(TaskExample example);
Task selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Task record, @Param("example") TaskExample example);
int updateByExample(@Param("record") Task record, @Param("example") TaskExample example);
int updateByPrimaryKeySelective(Task record);
int updateByPrimaryKey(Task record);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.TaskPack;
import com.viontech.label.platform.model.TaskPackExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TaskPackMapper extends BaseMapper {
int countByExample(TaskPackExample example);
int deleteByExample(TaskPackExample example);
int deleteByPrimaryKey(Long id);
int insert(TaskPack record);
int insertSelective(TaskPack record);
List<TaskPack> selectByExample(TaskPackExample example);
TaskPack selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TaskPack record, @Param("example") TaskPackExample example);
int updateByExample(@Param("record") TaskPack record, @Param("example") TaskPackExample example);
int updateByPrimaryKeySelective(TaskPack record);
int updateByPrimaryKey(TaskPack record);
}
\ No newline at end of file \ No newline at end of file
package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.User;
import com.viontech.label.platform.model.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UserMapper extends BaseMapper {
int countByExample(UserExample example);
int deleteByExample(UserExample example);
int deleteByPrimaryKey(Long id);
int insert(User record);
int insertSelective(User record);
List<User> selectByExample(UserExample example);
User selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
int updateByExample(@Param("record") User record, @Param("example") UserExample example);
int updateByPrimaryKeySelective(User record);
int updateByPrimaryKey(User record);
}
\ No newline at end of file \ No newline at end of file
<?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.viontech.label.platform.mapper.DictMapper" >
<resultMap id="BaseResultMapRoot" type="com.viontech.label.platform.model.Dict" >
<id column="dict_id" property="id" />
<result column="dict_unid" property="unid" />
<result column="dict_create_time" property="createTime" />
<result column="dict_create_user" property="createUser" />
<result column="dict_key" property="key" />
<result column="dict_value" property="value" />
<result column="dict_description" property="description" />
</resultMap>
<resultMap id="BaseResultMap" type="com.viontech.label.platform.model.Dict" extends="BaseResultMapRoot" />
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List_Root" >
"dict".id as dict_id, "dict".unid as dict_unid, "dict".create_time as dict_create_time,
"dict".create_user as dict_create_user, "dict"."key" as "dict_key", "dict"."value" as "dict_value",
"dict".description as dict_description
</sql>
<sql id="Base_Column_List" >
<if test="!(_parameter.getClass().getSimpleName() == 'DictExample')" >
<include refid="com.viontech.label.platform.mapper.DictMapper.Base_Column_List_Root" />
</if>
<if test="_parameter.getClass().getSimpleName() == 'DictExample'" >
<foreach collection="columnContainerSet" item="columns" separator="," >
<choose >
<when test="columns.tableName == 's_dict'.toString()" >
<if test="columns.valid" >
${columns.columnContainerStr}
</if>
<if test="!columns.valid" >
<include refid="com.viontech.label.platform.mapper.DictMapper.Base_Column_List_Root" />
</if>
</when>
</choose>
</foreach>
</if>
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.viontech.label.platform.model.DictExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from "s_dict" "dict"
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="groupByClause != null" >
group by ${groupByClause}
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from "s_dict" "dict"
where "dict".id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from "s_dict" "dict"
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.viontech.label.platform.model.DictExample" >
delete from "s_dict" "dict"
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.viontech.label.platform.model.Dict" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "s_dict" (unid, create_time, create_user,
"key", "value", description
)
values (#{unid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=BIGINT},
#{key,jdbcType=VARCHAR}, #{value,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.viontech.label.platform.model.Dict" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "s_dict"
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="unid != null" >
unid,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="createUser != null" >
create_user,
</if>
<if test="key != null" >
"key",
</if>
<if test="value != null" >
"value",
</if>
<if test="description != null" >
description,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="unid != null" >
#{unid,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUser != null" >
#{createUser,jdbcType=BIGINT},
</if>
<if test="key != null" >
#{key,jdbcType=VARCHAR},
</if>
<if test="value != null" >
#{value,jdbcType=INTEGER},
</if>
<if test="description != null" >
#{description,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.viontech.label.platform.model.DictExample" resultType="java.lang.Integer" >
select count(*) from "s_dict" "dict"
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update "s_dict" "dict"
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.unid != null" >
unid = #{record.unid,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null" >
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.createUser != null" >
create_user = #{record.createUser,jdbcType=BIGINT},
</if>
<if test="record.key != null" >
"key" = #{record.key,jdbcType=VARCHAR},
</if>
<if test="record.value != null" >
"value" = #{record.value,jdbcType=INTEGER},
</if>
<if test="record.description != null" >
description = #{record.description,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update "s_dict" "dict"
set id = #{record.id,jdbcType=BIGINT},
unid = #{record.unid,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
create_user = #{record.createUser,jdbcType=BIGINT},
"key" = #{record.key,jdbcType=VARCHAR},
"value" = #{record.value,jdbcType=INTEGER},
description = #{record.description,jdbcType=VARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.viontech.label.platform.model.Dict" >
update "s_dict"
<set >
<if test="unid != null" >
unid = #{unid,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUser != null" >
create_user = #{createUser,jdbcType=BIGINT},
</if>
<if test="key != null" >
"key" = #{key,jdbcType=VARCHAR},
</if>
<if test="value != null" >
"value" = #{value,jdbcType=INTEGER},
</if>
<if test="description != null" >
description = #{description,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.viontech.label.platform.model.Dict" >
update "s_dict"
set unid = #{unid,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_user = #{createUser,jdbcType=BIGINT},
"key" = #{key,jdbcType=VARCHAR},
"value" = #{value,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.viontech.label.platform.mapper.LogMapper" >
<resultMap id="BaseResultMapRoot" type="com.viontech.label.platform.model.Log" >
<id column="log_id" property="id" />
<result column="log_create_time" property="createTime" />
<result column="log_operate_user" property="operateUser" />
<result column="log_operate_date" property="operateDate" />
<result column="log_operate_type" property="operateType" />
<result column="log_operate" property="operate" />
</resultMap>
<resultMap id="BaseResultMap" type="com.viontech.label.platform.model.Log" extends="BaseResultMapRoot" />
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List_Root" >
"log".id as log_id, "log".create_time as log_create_time, "log".operate_user as log_operate_user,
"log".operate_date as log_operate_date, "log".operate_type as log_operate_type, "log".operate as log_operate
</sql>
<sql id="Base_Column_List" >
<if test="!(_parameter.getClass().getSimpleName() == 'LogExample')" >
<include refid="com.viontech.label.platform.mapper.LogMapper.Base_Column_List_Root" />
</if>
<if test="_parameter.getClass().getSimpleName() == 'LogExample'" >
<foreach collection="columnContainerSet" item="columns" separator="," >
<choose >
<when test="columns.tableName == 's_log'.toString()" >
<if test="columns.valid" >
${columns.columnContainerStr}
</if>
<if test="!columns.valid" >
<include refid="com.viontech.label.platform.mapper.LogMapper.Base_Column_List_Root" />
</if>
</when>
</choose>
</foreach>
</if>
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.viontech.label.platform.model.LogExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from "s_log" "log"
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="groupByClause != null" >
group by ${groupByClause}
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from "s_log" "log"
where "log".id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from "s_log" "log"
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.viontech.label.platform.model.LogExample" >
delete from "s_log" "log"
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.viontech.label.platform.model.Log" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "s_log" (create_time, operate_user, operate_date,
operate_type, operate)
values (#{createTime,jdbcType=TIMESTAMP}, #{operateUser,jdbcType=BIGINT}, #{operateDate,jdbcType=DATE},
#{operateType,jdbcType=INTEGER}, #{operate,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.viontech.label.platform.model.Log" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "s_log"
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="createTime != null" >
create_time,
</if>
<if test="operateUser != null" >
operate_user,
</if>
<if test="operateDate != null" >
operate_date,
</if>
<if test="operateType != null" >
operate_type,
</if>
<if test="operate != null" >
operate,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="operateUser != null" >
#{operateUser,jdbcType=BIGINT},
</if>
<if test="operateDate != null" >
#{operateDate,jdbcType=DATE},
</if>
<if test="operateType != null" >
#{operateType,jdbcType=INTEGER},
</if>
<if test="operate != null" >
#{operate,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.viontech.label.platform.model.LogExample" resultType="java.lang.Integer" >
select count(*) from "s_log" "log"
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update "s_log" "log"
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.createTime != null" >
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.operateUser != null" >
operate_user = #{record.operateUser,jdbcType=BIGINT},
</if>
<if test="record.operateDate != null" >
operate_date = #{record.operateDate,jdbcType=DATE},
</if>
<if test="record.operateType != null" >
operate_type = #{record.operateType,jdbcType=INTEGER},
</if>
<if test="record.operate != null" >
operate = #{record.operate,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update "s_log" "log"
set id = #{record.id,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
operate_user = #{record.operateUser,jdbcType=BIGINT},
operate_date = #{record.operateDate,jdbcType=DATE},
operate_type = #{record.operateType,jdbcType=INTEGER},
operate = #{record.operate,jdbcType=VARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.viontech.label.platform.model.Log" >
update "s_log"
<set >
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="operateUser != null" >
operate_user = #{operateUser,jdbcType=BIGINT},
</if>
<if test="operateDate != null" >
operate_date = #{operateDate,jdbcType=DATE},
</if>
<if test="operateType != null" >
operate_type = #{operateType,jdbcType=INTEGER},
</if>
<if test="operate != null" >
operate = #{operate,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.viontech.label.platform.model.Log" >
update "s_log"
set create_time = #{createTime,jdbcType=TIMESTAMP},
operate_user = #{operateUser,jdbcType=BIGINT},
operate_date = #{operateDate,jdbcType=DATE},
operate_type = #{operateType,jdbcType=INTEGER},
operate = #{operate,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
This diff is collapsed. Click to expand it.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!