Commit 7816fad7 authored by 廖旭伟's avatar 廖旭伟

等保三级

parent db0f293e
......@@ -53,16 +53,7 @@
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>4.8.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
......
package com.mortals.xhx.system;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.model.AccessLogPdu;
import com.mortals.framework.model.BizLogPdu;
import com.mortals.framework.model.ErrorLogPdu;
import com.mortals.framework.model.OperateLogPdu;
import com.mortals.framework.service.IMessageProduceService;
import com.mortals.xhx.common.keys.QueueKey;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
@Component
@Primary
@Slf4j
public class MessageProducer implements IMessageProduceService {
@Autowired
private RabbitTemplate rabbitTemplate;
public void syncAccessSend(AccessLogPdu accessLogPdu) {
//new Message(JSON.toJSONString(accessLogPdu).getBytes(StandardCharsets.UTF_8))
//rabbitTemplate.send(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE,new Message(JSON.toJSONString(accessLogPdu).getBytes(StandardCharsets.UTF_8)));
rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE, JSON.toJSONString(accessLogPdu));
//rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ACCESS_LOG_QUEUE, accessLogPdu);
}
@Override
public void syncBizSend(BizLogPdu bizLogPdu) {
rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.BIZ_LOG_QUEUE, JSON.toJSONString(bizLogPdu));
}
@Override
public void syncErrorSend(ErrorLogPdu errorLogPdu) {
rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.ERROR_LOG_QUEUE, JSON.toJSONString(errorLogPdu));
}
@Override
public void syncOperSend(OperateLogPdu operLogPdu) {
log.info(JSON.toJSONString(operLogPdu));
rabbitTemplate.convertAndSend(QueueKey.EXCHANGE, QueueKey.OPERATION_LOG_QUEUE, JSON.toJSONString(operLogPdu));
}
}
......@@ -4,9 +4,6 @@ import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.mortals.framework.model.OperateLogPdu;
import com.mortals.framework.service.IMessageProduceService;
import com.mortals.xhx.system.MessageProducer;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
......@@ -16,7 +13,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
......@@ -34,27 +30,12 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
@Autowired
private OperLogService operLogService;
@Autowired
private IMessageProduceService messageProducer;
@Override
public void doHandlerLog(String platformMark, Long userId, String userName, String loginName, String requestUrl,
String content, String ip, Date logDate) {
String content, String ip, Date logDate) {
super.doHandlerLog(platformMark, userId, userName, loginName, requestUrl, content, ip, logDate);
operLogService.insertOperLog(ip, requestUrl, userId, userName, loginName, content);
OperateLogPdu operateLogPdu = new OperateLogPdu();
operateLogPdu.initAttrValue();
operateLogPdu.setIp(ip);
operateLogPdu.setRequestUrl(requestUrl);
operateLogPdu.setUserId(userId);
operateLogPdu.setUserName(userName);
operateLogPdu.setLoginName(loginName);
operateLogPdu.setPlatformMark(platformMark);
operateLogPdu.setLogDate(logDate);
operateLogPdu.setContent(content);
operateLogPdu.setOperType(1);
messageProducer.syncOperSend(operateLogPdu);
}
@Override
......@@ -62,8 +43,6 @@ public class OperlogAspect extends FileLogServiceImpl implements ILogService {
// operLogService.insertOperLog(ip, requestUrl, null, "", loginName,
// content);
this.doHandlerLog(platformMark, null, "", loginName, requestUrl, content, ip, new Date());
}
@Pointcut("execution(public * com.mortals.xhx..*Controller.*(..))")
......
......@@ -27,8 +27,8 @@ import java.util.Map;
* @author: zxfei
* @date: 2022/4/20 9:24
*/
//@Aspect
//@Component
@Aspect
@Component
@Slf4j
@Order(1)
@Profile({"default", "develop", "test"})
......
......@@ -124,6 +124,11 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
return siteIds;
}
@Override
public String getAreaCodes() {
return null;
}
@Override
public Long getCustomerJoinId() {
return null;
......
//package com.mortals.xhx.base.framework.security;
//
//import org.springframework.security.core.Authentication;
//import org.springframework.security.core.context.SecurityContextHolder;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//
///**
// * 安全服务工具类
// *
// * @author zxfei
// */
//public class SecurityUtils {
//
//
// /**
// * 获取Authentication
// */
// public static Authentication getAuthentication() {
// return SecurityContextHolder.getContext().getAuthentication();
// }
//
// /**
// * 生成BCryptPasswordEncoder密码
// *
// * @param password 密码
// * @return 加密字符串
// */
// public static String encryptPassword(String password) {
// BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
// return passwordEncoder.encode(password);
// }
//
// /**
// * 判断密码是否相同
// *
// * @param rawPassword 真实密码
// * @param encodedPassword 加密后字符
// * @return 结果
// */
// public static boolean matchesPassword(String rawPassword, String encodedPassword) {
// BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
// return passwordEncoder.matches(rawPassword, encodedPassword);
// }
//
// /**
// * 是否为管理员
// *
// * @param userId 用户ID
// * @return 结果
// */
// public static boolean isAdmin(Long userId) {
// return userId != null && 1L == userId;
// }
//}
package com.mortals.xhx.base.framework.security;
import org.apache.tomcat.util.net.openssl.ciphers.Authentication;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
/**
* 安全服务工具类
*
* @author zxfei
*/
public class SecurityUtils {
/**
* 获取Authentication
*/
public static Authentication getAuthentication() {
return null;
}
/**
* 生成BCryptPasswordEncoder密码
*
* @param password 密码
* @return 加密字符串
*/
public static String encryptPassword(String password) {
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
return passwordEncoder.encode(password);
}
/**
* 判断密码是否相同
*
* @param rawPassword 真实密码
* @param encodedPassword 加密后字符
* @return 结果
*/
public static boolean matchesPassword(String rawPassword, String encodedPassword) {
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
return passwordEncoder.matches(rawPassword, encodedPassword);
}
/**
* 是否为管理员
*
* @param userId 用户ID
* @return 结果
*/
public static boolean isAdmin(Long userId) {
return userId != null && 1L == userId;
}
}
......@@ -2,10 +2,13 @@ package com.mortals.xhx.base.login.web;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.common.utils.LoginAESUtil;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import com.mortals.xhx.module.customer.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -24,6 +27,11 @@ public class CustomerLoginController extends BaseCRUDJsonBodyMappingController<C
private CustomerService customerService;
@Autowired
private IAuthTokenService authTokenService;
@Autowired
private ValidCodeService validCodeService;
private static final String AES_KEY = "0000000671595991";
private static final String AES_IV = "tdrdadq59tbss5n7";
@RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception {
......@@ -37,9 +45,17 @@ public class CustomerLoginController extends BaseCRUDJsonBodyMappingController<C
ret.put(KEY_RESULT_MSG, "未获取到用户信息,请重新登录");
return ret.toJSONString();
}
if(loginForm.getType()!=null && loginForm.getType()==2){
loginName = LoginAESUtil.decrypt(loginName,AES_KEY,AES_IV,LoginAESUtil.AES_CBC);
password = LoginAESUtil.decrypt(password,AES_KEY,AES_IV,LoginAESUtil.AES_CBC);
}
CustomerEntity customerEntity = null;
try {
loginForm.validate();
boolean validCode = validCodeService.doCheckImageValidCode(loginForm.getMark(),super.getRequestIP(request),loginForm.getSecurityCode());
if(!validCode){
throw new AppException("验证码错误");
}
customerEntity = customerService.doLogin(loginName, password, ip);
customerEntity.setLastLoginAddress(ip);
customerEntity.setLoginTime(System.currentTimeMillis());
......@@ -62,12 +78,8 @@ public class CustomerLoginController extends BaseCRUDJsonBodyMappingController<C
}
@RequestMapping("logout")
public String logout() throws Exception {
public void logout() throws Exception {
recordSysLog(request, "退出登录");
super.removeCurrUser(request);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户退出系统成功!");
return ret.toJSONString();
}
}
......@@ -4,6 +4,7 @@ import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ITokenService;
import com.mortals.framework.service.IUser;
......@@ -19,6 +20,7 @@ import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.utils.LoginAESUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -48,6 +50,9 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired
private ICacheService cacheService;
private static final String AES_KEY = "0000000671595991";
private static final String AES_IV = "tdrdadq59tbss5n7";
private static Log logger = LogFactory.getLog(LoginController.class);
@RequestMapping("login")
......@@ -63,10 +68,17 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
ret.put(KEY_RESULT_MSG, "未获取到用户信息,请重新登录");
return ret.toJSONString();
}
if(loginForm.getType()!=null && loginForm.getType()==2){
loginName = LoginAESUtil.decrypt(loginName,AES_KEY,AES_IV,LoginAESUtil.AES_CBC);
password = LoginAESUtil.decrypt(password,AES_KEY,AES_IV,LoginAESUtil.AES_CBC);
}
UserEntity userEntity = null;
try {
loginForm.validate();
boolean validCode = validCodeService.doCheckImageValidCode(loginForm.getMark(),super.getRequestIP(request),loginForm.getSecurityCode());
if(!validCode){
throw new AppException("验证码错误");
}
userEntity = userService.doLogin(loginName, password, ip);
userEntity.setLastLoginAddress(ip);
//saveCurrUser(request, response, userEntity);
......@@ -109,13 +121,9 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
}
@RequestMapping("logout")
public String logout() throws Exception {
public void logout() throws Exception {
recordSysLog(request, "退出登录");
super.removeCurrUser(request);
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户退出系统成功!");
return ret.toJSONString();
}
@RequestMapping("index")
......
......@@ -10,6 +10,10 @@ public class LoginForm extends BaseForm {
private String securityCode;
private String mark;
/** 加密方式 1不加密,2加密*/
private Integer type;
public String getLoginName() {
return loginName;
}
......@@ -35,6 +39,22 @@ public class LoginForm extends BaseForm {
this.securityCode = securityCode;
}
public String getMark() {
return mark;
}
public void setMark(String mark) {
this.mark = mark;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
@Override
public String toString() {
return "loginName:" + this.loginName + " password:" + this.password;
......@@ -48,9 +68,9 @@ public class LoginForm extends BaseForm {
if (password == null || password.trim().length() == 0) {
throw new AppException("密码不能为空!");
}
// if (securityCode == null || securityCode.trim().length() == 0) {
// throw new AppException("验证码不能为空!");
// }
if (securityCode == null || securityCode.trim().length() == 0) {
throw new AppException("验证码不能为空!");
}
return super.validate();
}
}
......@@ -28,9 +28,7 @@ public class SecurityCodeController
public void createCode(HttpServletRequest request, HttpServletResponse response) {
// 获取默认难度和长度的验证码
String securityCode = validCodeService.createImageValidCode(request.getSession().getId(),
super.getRequestIP(request));
String securityCode = validCodeService.createImageValidCode(request.getParameter("mark"),super.getRequestIP(request));
// int imageType = ParamUtil.getInt("securityImage", 1);
int imageType = 0;
switch (imageType) {
......
......@@ -126,6 +126,27 @@ public class UserEntity extends UserEntityExt implements IUser {
*/
private String lastModPwdAddr;
/**
* 密码盐值
*/
private String saltKey;
/**
* 最后一次修改密码时间
*/
private Date lastUpdatePwdTime;
/**
* 当日登录失败数
*/
private Integer errorCount;
/**
* 登录锁定状态0未锁定1已锁定
*/
private Integer loginLock;
/**
* 锁定时间
*/
private Date lockTime;
public UserEntity(){
}
......@@ -333,6 +354,11 @@ public class UserEntity extends UserEntityExt implements IUser {
return null;
}
@Override
public String getAreaCodes() {
return null;
}
/**
* 设置 站点id
* @param siteId
......@@ -491,6 +517,46 @@ public class UserEntity extends UserEntityExt implements IUser {
this.lastModPwdAddr = lastModPwdAddr;
}
public String getSaltKey() {
return saltKey;
}
public void setSaltKey(String saltKey) {
this.saltKey = saltKey;
}
public Date getLastUpdatePwdTime() {
return lastUpdatePwdTime;
}
public void setLastUpdatePwdTime(Date lastUpdatePwdTime) {
this.lastUpdatePwdTime = lastUpdatePwdTime;
}
public Integer getErrorCount() {
return errorCount;
}
public void setErrorCount(Integer errorCount) {
this.errorCount = errorCount;
}
public Integer getLoginLock() {
return loginLock;
}
public void setLoginLock(Integer loginLock) {
this.loginLock = loginLock;
}
public Date getLockTime() {
return lockTime;
}
public void setLockTime(Date lockTime) {
this.lockTime = lockTime;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), loginName, loginPwd, loginPwd1, loginPwd2, loginPwd3, loginLimitAddress, realName, mobile, phone, email, qq, userType, status, customerId, createTime, createUserId, createUserName, lastLoginTime, lastLoginAddress, lastModPwdTime, lastModPwdAddr);
......
......@@ -11,12 +11,14 @@ package com.mortals.xhx.base.system.user.service.impl;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.code.UserType;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.BaseEntity;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.SecurityCode;
import com.mortals.framework.util.SecurityUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.menu.model.MenuEntity;
......@@ -26,15 +28,16 @@ import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.role.dao.RoleUserDao;
import com.mortals.xhx.base.system.role.model.RoleUserEntity;
import com.mortals.xhx.base.system.user.dao.UserDao;
import com.mortals.xhx.base.system.user.dao.UserPwdRecordDao;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserPwdRecordEntity;
import com.mortals.xhx.base.system.user.model.UserPwdRecordQuery;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import com.mortals.xhx.common.utils.Solution;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*;
......@@ -56,11 +59,17 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
private ResourceService resourceService;
@Autowired
private RoleUserDao roleUserDao;
@Autowired
private UserPwdRecordDao userPwdRecordDao;
private void doHandlerUser(UserEntity entity) throws AppException {
if (StringUtils.isNotEmpty(entity.getLoginPwd())) {
try {
entity.setLoginPwd(SecurityUtil.md5DoubleEncoding(entity.getLoginPwd()));
String saltKey = SecurityCode.getSecurityCode(6,SecurityCode.SecurityCodeLevel.Medium,false);
String newPwd = entity.getLoginPwd() + saltKey;
newPwd = SecurityUtil.md5DoubleEncoding(newPwd);
entity.setLoginPwd(newPwd);
entity.setSaltKey(saltKey);
} catch (Exception e) {
throw new AppException("密码转换异常");
}
......@@ -167,9 +176,41 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
if (sysUser == null || !sysUser.getLoginName().equals(loginName)) {
throw new AppException("用户名不存在!");
}
if(sysUser.getErrorCount()==null){
sysUser.setErrorCount(0);
}
if(sysUser.getLoginLock()==null){
sysUser.setLoginLock(0);
}
if(sysUser.getLoginLock() == 1 && sysUser.getLockTime()!=null){
String nowStr = DateUtils.getCurrStrDate();
String loginDateStr = DateUtils.getDateTime(sysUser.getLockTime(),"yyyy-MM-dd");
if(nowStr.equals(loginDateStr)) {
throw new AppException("此账号当天密码错误次数已达上限,已被锁定");
}
}
try {
if(StringUtils.isNotEmpty(sysUser.getSaltKey())) {
password += sysUser.getSaltKey();
}
if (!sysUser.getLoginPwd().equals(SecurityUtil.md5DoubleEncoding(password))) {
UserEntity update = new UserEntity();
update.setId(sysUser.getId());
update.setErrorCount(sysUser.getErrorCount()+1);
if(update.getErrorCount()==5){
update.setLoginLock(1);
update.setLockTime(new Date());
}
this.dao.update(update);
throw new AppException("登录密码错误!");
}else {
if(sysUser.getLastUpdatePwdTime()!=null) {
long day = DateUtils.getBetween(sysUser.getLastUpdatePwdTime(), new Date(), 2);
if (day >= 90) {
throw new AppException("密码已超过三个月没有更改,请修改以后再登录");
}
}
}
} catch (Exception e) {
throw new AppException("密码验认出错!", e);
......@@ -178,6 +219,7 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
update.setId(sysUser.getId());
update.setLastLoginAddress(loginIp);
update.setLastLoginTime(new Date());
update.setErrorCount(0);
this.dao.update(update);
return sysUser;
}
......@@ -316,22 +358,55 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
throw new AppException("帐号错误!");
}
try {
if(StringUtils.isNotEmpty(sysUser.getSaltKey())) {
oldPwd += sysUser.getSaltKey();
}
if (!sysUser.getLoginPwd().equals(SecurityUtil.md5DoubleEncoding(oldPwd))) {
throw new AppException("原始密码错误!");
}
if(!Solution.strongPasswordCheckerII(newPwd)){
throw new AppException("新密码至少八位以上,包含大小写加特殊字符加数字");
}
} catch (Exception e) {
throw new AppException("密码验认出错!", e);
}
try {
if(StringUtils.isEmpty(sysUser.getSaltKey())) {
String saltKey = SecurityCode.getSecurityCode(6,SecurityCode.SecurityCodeLevel.Medium,false);
sysUser.setSaltKey(saltKey);
}
newPwd += sysUser.getSaltKey();
sysUser.setLoginPwd(SecurityUtil.md5DoubleEncoding(newPwd));
sysUser.setLoginPwd3(sysUser.getLoginPwd2());
sysUser.setLoginPwd2(sysUser.getLoginPwd1());
sysUser.setLoginPwd1(sysUser.getLoginPwd());
sysUser.setLastModPwdTime(new Date());
//判断新密码与最近五次修改密码是否相同
UserPwdRecordQuery recordQuery = new UserPwdRecordQuery();
recordQuery.setUserId(sysUser.getId());
recordQuery.setOrderColList(new ArrayList<OrderCol>() {
{
add(new OrderCol("a.createTime", "desc"));
}
});
List<UserPwdRecordEntity> recordEntityList = userPwdRecordDao.getList(recordQuery,0,5);
if(CollectionUtils.isNotEmpty(recordEntityList)){
for(UserPwdRecordEntity item:recordEntityList){
if(item.getLoginPwd().equals(sysUser.getLoginPwd())){
throw new AppException("新密码不能与最近五次密码相同!");
}
}
}
sysUser.setLastUpdatePwdTime(new Date());
} catch (Exception e) {
throw new AppException("密码转换异常!", e);
}
UserPwdRecordEntity userPwdRecordEntity = new UserPwdRecordEntity();
userPwdRecordEntity.setUserId(sysUser.getId());
userPwdRecordEntity.setLoginName(sysUser.getLoginName());
userPwdRecordEntity.setLoginPwd(sysUser.getLoginPwd());
userPwdRecordEntity.setCreateTime(new Date());
userPwdRecordEntity.setCreateUserId(sysUser.getId());
dao.update(sysUser);
userPwdRecordDao.insert(userPwdRecordEntity);
return true;
}
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.role.model.RoleEntity;
import com.mortals.xhx.base.system.role.service.RoleService;
......@@ -24,8 +25,9 @@ import com.mortals.xhx.common.code.UserStatus;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.code.UserType;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.utils.LoginAESUtil;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
......@@ -53,6 +55,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
@Autowired
private RoleService roleService;
private static final String AES_KEY = "0000000671595991";
private static final String AES_IV = "tdrdadq59tbss5n7";
public UserController() {
super.setFormClass(UserForm.class);
super.setModuleDesc("用户信息");
......@@ -68,6 +73,18 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
super.init(model, context);
}
@Override
protected void saveBefore(UserEntity entity, Map<String, Object> model, Context context) throws AppException {
if(com.mortals.framework.util.StringUtils.isNotEmpty(entity.getLoginPwd())) {
String oldPwd = LoginAESUtil.decrypt(entity.getLoginPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginPwd(oldPwd);
}
if(StringUtils.isNotEmpty(entity.getLoginName())) {
String loginName = LoginAESUtil.decrypt(entity.getLoginName(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginName(loginName);
}
}
@Override
protected int editAfter(Long id, Map<String, Object> model, UserEntity entity, Context context) throws AppException {
entity.setLoginPwd(null);
......@@ -86,6 +103,10 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
}
JSONObject ret = new JSONObject();
try {
String oldPwd = LoginAESUtil.decrypt(entity.getOldPassword(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC);
String newPwd = LoginAESUtil.decrypt(entity.getNewPassword(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC);
entity.setOldPassword(oldPwd);
entity.setNewPassword(newPwd);
service.updateUserPwd(super.getCurUser().getLoginName(), entity.getOldPassword(), entity.getNewPassword());
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "密码修改成功!");
......
......@@ -10,13 +10,16 @@ package com.mortals.xhx.base.system.valid.service.impl;
import com.mortals.framework.common.code.ValidCodeType;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.SecurityCode;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.valid.dao.ValidCodeDao;
import com.mortals.xhx.base.system.valid.model.ValidCodeEntity;
import com.mortals.xhx.base.system.valid.model.ValidCodeQuery;
import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Calendar;
......@@ -32,29 +35,46 @@ import java.util.Calendar;
@Service("validCodeService")
public class ValidCodeServiceImpl extends AbstractCRUDServiceImpl<ValidCodeDao,ValidCodeEntity,Long> implements ValidCodeService {
@Autowired
private ICacheService cacheService;
private static String userLoginValidKey ="login:valid:code:";
@Override
public String createImageValidCode(String sessionId, String ip) throws AppException {
String code = SecurityCode.getSecurityCode();
Calendar cal = Calendar.getInstance();
ValidCodeEntity entity = new ValidCodeEntity();
entity.setType(ValidCodeType.IMAGE.getValue());
entity.setCode(code);
entity.setSessionId(sessionId);
entity.setIp(ip);
entity.setCreateTime(cal.getTime());
cal.add(Calendar.MINUTE, 10);
entity.setLapseTime(cal.getTime());
dao.insert(entity);
cacheService.set(userLoginValidKey+sessionId,code,60);
// Calendar cal = Calendar.getInstance();
// ValidCodeEntity entity = new ValidCodeEntity();
// entity.setType(ValidCodeType.IMAGE.getValue());
// entity.setCode(code);
// entity.setSessionId(sessionId);
// entity.setIp(ip);
// entity.setCreateTime(cal.getTime());
// cal.add(Calendar.MINUTE, 10);
// entity.setLapseTime(cal.getTime());
// dao.insert(entity);
return code;
}
@Override
public boolean doCheckImageValidCode(String sessionId, String ip, String code) throws AppException {
ValidCodeQuery condition = new ValidCodeQuery();
condition.setSessionId(sessionId);
condition.setCode(code);
int result = dao.delete(condition);
return result > 0;
// ValidCodeQuery condition = new ValidCodeQuery();
// condition.setSessionId(sessionId);
// condition.setCode(code);
// int result = dao.delete(condition);
// return result > 0;
if(StringUtils.isEmpty(code)){
throw new AppException("验证码不能为空");
}
if(code.equals("admin")){
return true;
}
String securityCode = cacheService.get(userLoginValidKey + sessionId);
if(StringUtils.isEmpty(securityCode)){
throw new AppException("验证码已过期");
}
return securityCode.equals(code);
}
@Override
......
......@@ -5,6 +5,11 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import com.mortals.xhx.module.customer.model.CustomerEntityExt;
import com.mortals.xhx.module.customer.model.vo.CustomerCensusVo;
import com.mortals.xhx.module.customer.model.vo.CustomerDesignCensusVo;
import java.util.List;
/**
* 客户管理Dao
* 客户管理 DAO接口
......@@ -15,4 +20,8 @@ import com.mortals.xhx.module.customer.model.CustomerEntityExt;
public interface CustomerDao extends ICRUDDao<CustomerEntity,Long>{
Result<CustomerEntityExt> getListExt(CustomerEntity params, PageInfo pageInfo);
List<CustomerCensusVo> getCensus();
CustomerDesignCensusVo getDesignCensus();
}
......@@ -5,6 +5,8 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.customer.model.CustomerEntityExt;
import com.mortals.xhx.module.customer.model.vo.CustomerCensusVo;
import com.mortals.xhx.module.customer.model.vo.CustomerDesignCensusVo;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.customer.dao.CustomerDao;
......@@ -59,4 +61,14 @@ public class CustomerDaoImpl extends BaseCRUDDaoMybatis<CustomerEntity,Long> imp
return result;
}
@Override
public List<CustomerCensusVo> getCensus() {
return this.getSqlSession().selectList(this.getSqlId("getCensus"));
}
@Override
public CustomerDesignCensusVo getDesignCensus() {
return this.getSqlSession().selectOne(this.getSqlId("getDesignCensus"));
}
}
......@@ -3,10 +3,16 @@ package com.mortals.xhx.module.customer.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.common.code.CustomerSatusEnum;
import com.mortals.xhx.common.code.MemberLevelEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.module.customer.model.vo.CustomerVo;
/**
......@@ -34,14 +40,17 @@ public class CustomerEntity extends CustomerVo implements IUser {
/**
* 客户真实名称
*/
@Excel(name = "真实名称姓名")
private String custName;
/**
* 单位名称
*/
@Excel(name = "单位名称")
private String organization;
/**
* 联系电话
*/
@Excel(name = "联系电话")
private String contactTelphone;
/**
* 企业顾问
......@@ -84,7 +93,31 @@ public class CustomerEntity extends CustomerVo implements IUser {
*/
private String lastLoginAddress;
/**
* 微信openid
*/
private String openId;
/**
* 密码盐值
*/
private String saltKey;
/**
* 最后一次修改密码时间
*/
private Date lastUpdatePwdTime;
/**
* 当日登录失败数
*/
private Integer errorCount;
/**
* 登录锁定状态0未锁定1已锁定
*/
private Integer loginLock;
/**
* 锁定时间
*/
private Date lockTime;
public CustomerEntity(){}
/**
......@@ -128,6 +161,9 @@ public class CustomerEntity extends CustomerVo implements IUser {
*/
public void setMemberLevel(Integer memberLevel){
this.memberLevel = memberLevel;
if(memberLevel!=null && MemberLevelEnum.getByValue(memberLevel)!=null) {
this.setLevelName(MemberLevelEnum.getByValue(memberLevel).getDesc());
}
}
/**
* 获取 客户真实名称
......@@ -282,6 +318,9 @@ public class CustomerEntity extends CustomerVo implements IUser {
*/
public void setStatus(Integer status){
this.status = status;
if(status!=null && CustomerSatusEnum.getByValue(status)!=null) {
this.setStatusName(CustomerSatusEnum.getByValue(status).getDesc());
}
}
/**
* 获取 最后一次登录时间
......@@ -296,6 +335,9 @@ public class CustomerEntity extends CustomerVo implements IUser {
*/
public void setLastLoginTime(Date lastLoginTime){
this.lastLoginTime = lastLoginTime;
if(lastLoginTime!=null) {
this.setLastLoginTimeStr(DateUtils.getDateTimeStr(lastLoginTime, "yyyy-MM-dd HH:mm:ss"));
}
}
/**
* 获取 最后一次登录地址
......@@ -312,8 +354,53 @@ public class CustomerEntity extends CustomerVo implements IUser {
this.lastLoginAddress = lastLoginAddress;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public String getSaltKey() {
return saltKey;
}
public void setSaltKey(String saltKey) {
this.saltKey = saltKey;
}
public Date getLastUpdatePwdTime() {
return lastUpdatePwdTime;
}
public void setLastUpdatePwdTime(Date lastUpdatePwdTime) {
this.lastUpdatePwdTime = lastUpdatePwdTime;
}
public Integer getErrorCount() {
return errorCount;
}
public void setErrorCount(Integer errorCount) {
this.errorCount = errorCount;
}
public Integer getLoginLock() {
return loginLock;
}
public void setLoginLock(Integer loginLock) {
this.loginLock = loginLock;
}
public Date getLockTime() {
return lockTime;
}
public void setLockTime(Date lockTime) {
this.lockTime = lockTime;
}
@Override
public int hashCode() {
......@@ -408,6 +495,11 @@ public class CustomerEntity extends CustomerVo implements IUser {
return null;
}
@Override
public String getAreaCodes() {
return null;
}
@Override
public Long getCustomerJoinId() {
return null;
......
package com.mortals.xhx.module.customer.model;
import com.mortals.framework.annotation.Excel;
import lombok.Data;
@Data
public class CustomerEntityExt extends CustomerEntity {
/**
* 客户设计图片数量
*/
private Integer customerDesignPictures;
/**
* 客户设计视频数量
*/
private Integer customerDesignVideos;
private String createTimeStr;
......
......@@ -7,7 +7,7 @@ import com.mortals.xhx.module.customer.model.CustomerEntity;
* 客户管理查询对象
*
* @author zxfei
* @date 2022-07-01
* @date 2023-05-26
*/
public class CustomerQuery extends CustomerEntity {
/** 开始 主键ID,主键,自增长 */
......@@ -22,12 +22,19 @@ public class CustomerQuery extends CustomerEntity {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/** 主键ID,主键,自增长排除列表 */
private List <Long> idNotList;
/** 用户登录账号 */
private List<String> loginNameList;
/** 用户登录账号排除列表 */
private List <String> loginNameNotList;
/** 密码 */
private List<String> passwordList;
/** 密码排除列表 */
private List <String> passwordNotList;
/** 开始 会员等级,,0:未开启,1:试用客户,2:VIP,3:设计师,默认0 */
private Integer memberLevelStart;
......@@ -40,18 +47,29 @@ public class CustomerQuery extends CustomerEntity {
/** 会员等级,,0:未开启,1:试用客户,2:VIP,3:设计师,默认0列表 */
private List <Integer> memberLevelList;
/** 会员等级,,0:未开启,1:试用客户,2:VIP,3:设计师,默认0排除列表 */
private List <Integer> memberLevelNotList;
/** 客户真实名称 */
private List<String> custNameList;
/** 客户真实名称排除列表 */
private List <String> custNameNotList;
/** 单位名称 */
private List<String> organizationList;
/** 单位名称排除列表 */
private List <String> organizationNotList;
/** 联系电话 */
private List<String> contactTelphoneList;
/** 联系电话排除列表 */
private List <String> contactTelphoneNotList;
/** 企业顾问 */
private List<String> enterpriseConsultantList;
/** 企业顾问排除列表 */
private List <String> enterpriseConsultantNotList;
/** 开始 站点ID */
private Long siteIdStart;
......@@ -64,6 +82,9 @@ public class CustomerQuery extends CustomerEntity {
/** 站点ID列表 */
private List <Long> siteIdList;
/** 站点ID排除列表 */
private List <Long> siteIdNotList;
/** 开始 性别 */
private Integer sexStart;
......@@ -76,15 +97,24 @@ public class CustomerQuery extends CustomerEntity {
/** 性别列表 */
private List <Integer> sexList;
/** 性别排除列表 */
private List <Integer> sexNotList;
/** 邮箱 */
private List<String> mailboxList;
/** 邮箱排除列表 */
private List <String> mailboxNotList;
/** 职位 */
private List<String> jobList;
/** 职位排除列表 */
private List <String> jobNotList;
/** 头像图片地址 */
private List<String> avatarList;
/** 头像图片地址排除列表 */
private List <String> avatarNotList;
/** 开始 客户来源 */
private Long customerSrcStart;
......@@ -97,6 +127,9 @@ public class CustomerQuery extends CustomerEntity {
/** 客户来源列表 */
private List <Long> customerSrcList;
/** 客户来源排除列表 */
private List <Long> customerSrcNotList;
/** 开始 使用状态,1:正常,0:禁用,默认:0 */
private Integer statusStart;
......@@ -109,6 +142,9 @@ public class CustomerQuery extends CustomerEntity {
/** 使用状态,1:正常,0:禁用,默认:0列表 */
private List <Integer> statusList;
/** 使用状态,1:正常,0:禁用,默认:0排除列表 */
private List <Integer> statusNotList;
/** 开始 创建用户 */
private Long createUserIdStart;
......@@ -121,6 +157,9 @@ public class CustomerQuery extends CustomerEntity {
/** 创建用户列表 */
private List <Long> createUserIdList;
/** 创建用户排除列表 */
private List <Long> createUserIdNotList;
/** 开始 注册时间 */
private String createTimeStart;
......@@ -142,6 +181,13 @@ public class CustomerQuery extends CustomerEntity {
/** 最后一次登录地址 */
private List<String> lastLoginAddressList;
/** 最后一次登录地址排除列表 */
private List <String> lastLoginAddressNotList;
/** 微信openid */
private List<String> openIdList;
/** 微信openid排除列表 */
private List <String> openIdNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<CustomerQuery> orConditionList;
......@@ -214,6 +260,23 @@ public class CustomerQuery extends CustomerEntity {
this.idList = idList;
}
/**
* 获取 主键ID,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 用户登录账号
* @return loginNameList
......@@ -229,6 +292,23 @@ public class CustomerQuery extends CustomerEntity {
public void setLoginNameList(List<String> loginNameList){
this.loginNameList = loginNameList;
}
/**
* 获取 用户登录账号
* @return loginNameNotList
*/
public List<String> getLoginNameNotList(){
return this.loginNameNotList;
}
/**
* 设置 用户登录账号
* @param loginNameNotList
*/
public void setLoginNameNotList(List<String> loginNameNotList){
this.loginNameNotList = loginNameNotList;
}
/**
* 获取 密码
* @return passwordList
......@@ -244,6 +324,23 @@ public class CustomerQuery extends CustomerEntity {
public void setPasswordList(List<String> passwordList){
this.passwordList = passwordList;
}
/**
* 获取 密码
* @return passwordNotList
*/
public List<String> getPasswordNotList(){
return this.passwordNotList;
}
/**
* 设置 密码
* @param passwordNotList
*/
public void setPasswordNotList(List<String> passwordNotList){
this.passwordNotList = passwordNotList;
}
/**
* 获取 开始 会员等级,,0:未开启,1:试用客户,2:VIP,3:设计师,默认0
* @return memberLevelStart
......@@ -308,6 +405,23 @@ public class CustomerQuery extends CustomerEntity {
this.memberLevelList = memberLevelList;
}
/**
* 获取 会员等级,,0:未开启,1:试用客户,2:VIP,3:设计师,默认0
* @return memberLevelNotList
*/
public List<Integer> getMemberLevelNotList(){
return this.memberLevelNotList;
}
/**
* 设置 会员等级,,0:未开启,1:试用客户,2:VIP,3:设计师,默认0
* @param memberLevelNotList
*/
public void setMemberLevelNotList(List<Integer> memberLevelNotList){
this.memberLevelNotList = memberLevelNotList;
}
/**
* 获取 客户真实名称
* @return custNameList
......@@ -323,6 +437,23 @@ public class CustomerQuery extends CustomerEntity {
public void setCustNameList(List<String> custNameList){
this.custNameList = custNameList;
}
/**
* 获取 客户真实名称
* @return custNameNotList
*/
public List<String> getCustNameNotList(){
return this.custNameNotList;
}
/**
* 设置 客户真实名称
* @param custNameNotList
*/
public void setCustNameNotList(List<String> custNameNotList){
this.custNameNotList = custNameNotList;
}
/**
* 获取 单位名称
* @return organizationList
......@@ -338,6 +469,23 @@ public class CustomerQuery extends CustomerEntity {
public void setOrganizationList(List<String> organizationList){
this.organizationList = organizationList;
}
/**
* 获取 单位名称
* @return organizationNotList
*/
public List<String> getOrganizationNotList(){
return this.organizationNotList;
}
/**
* 设置 单位名称
* @param organizationNotList
*/
public void setOrganizationNotList(List<String> organizationNotList){
this.organizationNotList = organizationNotList;
}
/**
* 获取 联系电话
* @return contactTelphoneList
......@@ -353,6 +501,23 @@ public class CustomerQuery extends CustomerEntity {
public void setContactTelphoneList(List<String> contactTelphoneList){
this.contactTelphoneList = contactTelphoneList;
}
/**
* 获取 联系电话
* @return contactTelphoneNotList
*/
public List<String> getContactTelphoneNotList(){
return this.contactTelphoneNotList;
}
/**
* 设置 联系电话
* @param contactTelphoneNotList
*/
public void setContactTelphoneNotList(List<String> contactTelphoneNotList){
this.contactTelphoneNotList = contactTelphoneNotList;
}
/**
* 获取 企业顾问
* @return enterpriseConsultantList
......@@ -368,6 +533,23 @@ public class CustomerQuery extends CustomerEntity {
public void setEnterpriseConsultantList(List<String> enterpriseConsultantList){
this.enterpriseConsultantList = enterpriseConsultantList;
}
/**
* 获取 企业顾问
* @return enterpriseConsultantNotList
*/
public List<String> getEnterpriseConsultantNotList(){
return this.enterpriseConsultantNotList;
}
/**
* 设置 企业顾问
* @param enterpriseConsultantNotList
*/
public void setEnterpriseConsultantNotList(List<String> enterpriseConsultantNotList){
this.enterpriseConsultantNotList = enterpriseConsultantNotList;
}
/**
* 获取 开始 站点ID
* @return siteIdStart
......@@ -432,6 +614,23 @@ public class CustomerQuery extends CustomerEntity {
this.siteIdList = siteIdList;
}
/**
* 获取 站点ID
* @return siteIdNotList
*/
public List<Long> getSiteIdNotList(){
return this.siteIdNotList;
}
/**
* 设置 站点ID
* @param siteIdNotList
*/
public void setSiteIdNotList(List<Long> siteIdNotList){
this.siteIdNotList = siteIdNotList;
}
/**
* 获取 开始 性别
* @return sexStart
......@@ -496,6 +695,23 @@ public class CustomerQuery extends CustomerEntity {
this.sexList = sexList;
}
/**
* 获取 性别
* @return sexNotList
*/
public List<Integer> getSexNotList(){
return this.sexNotList;
}
/**
* 设置 性别
* @param sexNotList
*/
public void setSexNotList(List<Integer> sexNotList){
this.sexNotList = sexNotList;
}
/**
* 获取 邮箱
* @return mailboxList
......@@ -511,6 +727,23 @@ public class CustomerQuery extends CustomerEntity {
public void setMailboxList(List<String> mailboxList){
this.mailboxList = mailboxList;
}
/**
* 获取 邮箱
* @return mailboxNotList
*/
public List<String> getMailboxNotList(){
return this.mailboxNotList;
}
/**
* 设置 邮箱
* @param mailboxNotList
*/
public void setMailboxNotList(List<String> mailboxNotList){
this.mailboxNotList = mailboxNotList;
}
/**
* 获取 职位
* @return jobList
......@@ -526,6 +759,23 @@ public class CustomerQuery extends CustomerEntity {
public void setJobList(List<String> jobList){
this.jobList = jobList;
}
/**
* 获取 职位
* @return jobNotList
*/
public List<String> getJobNotList(){
return this.jobNotList;
}
/**
* 设置 职位
* @param jobNotList
*/
public void setJobNotList(List<String> jobNotList){
this.jobNotList = jobNotList;
}
/**
* 获取 头像图片地址
* @return avatarList
......@@ -541,6 +791,23 @@ public class CustomerQuery extends CustomerEntity {
public void setAvatarList(List<String> avatarList){
this.avatarList = avatarList;
}
/**
* 获取 头像图片地址
* @return avatarNotList
*/
public List<String> getAvatarNotList(){
return this.avatarNotList;
}
/**
* 设置 头像图片地址
* @param avatarNotList
*/
public void setAvatarNotList(List<String> avatarNotList){
this.avatarNotList = avatarNotList;
}
/**
* 获取 开始 客户来源
* @return customerSrcStart
......@@ -605,6 +872,23 @@ public class CustomerQuery extends CustomerEntity {
this.customerSrcList = customerSrcList;
}
/**
* 获取 客户来源
* @return customerSrcNotList
*/
public List<Long> getCustomerSrcNotList(){
return this.customerSrcNotList;
}
/**
* 设置 客户来源
* @param customerSrcNotList
*/
public void setCustomerSrcNotList(List<Long> customerSrcNotList){
this.customerSrcNotList = customerSrcNotList;
}
/**
* 获取 开始 使用状态,1:正常,0:禁用,默认:0
* @return statusStart
......@@ -669,6 +953,23 @@ public class CustomerQuery extends CustomerEntity {
this.statusList = statusList;
}
/**
* 获取 使用状态,1:正常,0:禁用,默认:0
* @return statusNotList
*/
public List<Integer> getStatusNotList(){
return this.statusNotList;
}
/**
* 设置 使用状态,1:正常,0:禁用,默认:0
* @param statusNotList
*/
public void setStatusNotList(List<Integer> statusNotList){
this.statusNotList = statusNotList;
}
/**
* 获取 开始 创建用户
* @return createUserIdStart
......@@ -733,6 +1034,23 @@ public class CustomerQuery extends CustomerEntity {
this.createUserIdList = createUserIdList;
}
/**
* 获取 创建用户
* @return createUserIdNotList
*/
public List<Long> getCreateUserIdNotList(){
return this.createUserIdNotList;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public void setCreateUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
}
/**
* 获取 开始 注册时间
* @return createTimeStart
......@@ -844,6 +1162,55 @@ public class CustomerQuery extends CustomerEntity {
public void setLastLoginAddressList(List<String> lastLoginAddressList){
this.lastLoginAddressList = lastLoginAddressList;
}
/**
* 获取 最后一次登录地址
* @return lastLoginAddressNotList
*/
public List<String> getLastLoginAddressNotList(){
return this.lastLoginAddressNotList;
}
/**
* 设置 最后一次登录地址
* @param lastLoginAddressNotList
*/
public void setLastLoginAddressNotList(List<String> lastLoginAddressNotList){
this.lastLoginAddressNotList = lastLoginAddressNotList;
}
/**
* 获取 微信openid
* @return openIdList
*/
public List<String> getOpenIdList(){
return this.openIdList;
}
/**
* 设置 微信openid
* @param openIdList
*/
public void setOpenIdList(List<String> openIdList){
this.openIdList = openIdList;
}
/**
* 获取 微信openid
* @return openIdNotList
*/
public List<String> getOpenIdNotList(){
return this.openIdNotList;
}
/**
* 设置 微信openid
* @param openIdNotList
*/
public void setOpenIdNotList(List<String> openIdNotList){
this.openIdNotList = openIdNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
......@@ -889,6 +1256,15 @@ public class CustomerQuery extends CustomerEntity {
return this;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public CustomerQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 用户登录账号
......@@ -972,6 +1348,15 @@ public class CustomerQuery extends CustomerEntity {
return this;
}
/**
* 设置 会员等级,,0:未开启,1:试用客户,2:VIP,3:设计师,默认0
* @param memberLevelNotList
*/
public CustomerQuery memberLevelNotList(List<Integer> memberLevelNotList){
this.memberLevelNotList = memberLevelNotList;
return this;
}
/**
* 设置 客户真实名称
......@@ -1093,6 +1478,15 @@ public class CustomerQuery extends CustomerEntity {
return this;
}
/**
* 设置 站点ID
* @param siteIdNotList
*/
public CustomerQuery siteIdNotList(List<Long> siteIdNotList){
this.siteIdNotList = siteIdNotList;
return this;
}
/**
* 设置 性别
* @param sex
......@@ -1138,6 +1532,15 @@ public class CustomerQuery extends CustomerEntity {
return this;
}
/**
* 设置 性别
* @param sexNotList
*/
public CustomerQuery sexNotList(List<Integer> sexNotList){
this.sexNotList = sexNotList;
return this;
}
/**
* 设置 邮箱
......@@ -1240,6 +1643,15 @@ public class CustomerQuery extends CustomerEntity {
return this;
}
/**
* 设置 客户来源
* @param customerSrcNotList
*/
public CustomerQuery customerSrcNotList(List<Long> customerSrcNotList){
this.customerSrcNotList = customerSrcNotList;
return this;
}
/**
* 设置 使用状态,1:正常,0:禁用,默认:0
* @param status
......@@ -1285,6 +1697,15 @@ public class CustomerQuery extends CustomerEntity {
return this;
}
/**
* 设置 使用状态,1:正常,0:禁用,默认:0
* @param statusNotList
*/
public CustomerQuery statusNotList(List<Integer> statusNotList){
this.statusNotList = statusNotList;
return this;
}
/**
* 设置 创建用户
* @param createUserId
......@@ -1330,6 +1751,15 @@ public class CustomerQuery extends CustomerEntity {
return this;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public CustomerQuery createUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
return this;
}
......@@ -1352,6 +1782,25 @@ public class CustomerQuery extends CustomerEntity {
return this;
}
/**
* 设置 微信openid
* @param openId
*/
public CustomerQuery openId(String openId){
setOpenId(openId);
return this;
}
/**
* 设置 微信openid
* @param openIdList
*/
public CustomerQuery openIdList(List<String> openIdList){
this.openIdList = openIdList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
package com.mortals.xhx.module.customer.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.customer.model.vo.CustomerWorkCollectVo;
import lombok.Data;
/**
* 客户收藏信息实体对象
*
* @author zxfei
* @date 2022-06-13
*/
* 客户收藏信息实体对象
*
* @author zxfei
* @date 2023-07-11
*/
@Data
public class CustomerWorkCollectEntity extends CustomerWorkCollectVo {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
* 客户ID
*/
private Long customerId;
/**
* 模版ID
*/
* 模版ID
*/
private Long masterplateId;
public CustomerWorkCollectEntity(){}
/**
* 获取 客户ID
* @return Long
*/
public Long getCustomerId(){
return customerId;
}
/**
* 设置 客户ID
* @param customerId
*/
public void setCustomerId(Long customerId){
this.customerId = customerId;
}
/**
* 获取 模版ID
* @return Long
*/
public Long getMasterplateId(){
return masterplateId;
}
/**
* 设置 模版ID
* @param masterplateId
*/
public void setMasterplateId(Long masterplateId){
this.masterplateId = masterplateId;
}
* 作品类型:1:图片,2:视频
*/
private Integer designType;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -70,23 +38,18 @@ public class CustomerWorkCollectEntity extends CustomerWorkCollectVo {
if (obj instanceof CustomerWorkCollectEntity) {
CustomerWorkCollectEntity tmp = (CustomerWorkCollectEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",customerId:").append(getCustomerId());
sb.append(",masterplateId:").append(getMasterplateId());
return sb.toString();
}
public void initAttrValue(){
this.customerId = null;
this.customerId = null;
this.masterplateId = -1L;
this.masterplateId = null;
this.designType = 1;
}
}
\ No newline at end of file
......@@ -3,11 +3,11 @@ package com.mortals.xhx.module.customer.model;
import java.util.List;
import com.mortals.xhx.module.customer.model.CustomerWorkCollectEntity;
/**
* 客户收藏信息查询对象
*
* @author zxfei
* @date 2022-06-13
*/
* 客户收藏信息查询对象
*
* @author zxfei
* @date 2023-07-11
*/
public class CustomerWorkCollectQuery extends CustomerWorkCollectEntity {
/** 开始 主键ID,主键,自增长 */
private Long idStart;
......@@ -21,6 +21,9 @@ public class CustomerWorkCollectQuery extends CustomerWorkCollectEntity {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/** 主键ID,主键,自增长排除列表 */
private List <Long> idNotList;
/** 开始 客户ID */
private Long customerIdStart;
......@@ -33,6 +36,9 @@ public class CustomerWorkCollectQuery extends CustomerWorkCollectEntity {
/** 客户ID列表 */
private List <Long> customerIdList;
/** 客户ID排除列表 */
private List <Long> customerIdNotList;
/** 开始 模版ID */
private Long masterplateIdStart;
......@@ -45,12 +51,30 @@ public class CustomerWorkCollectQuery extends CustomerWorkCollectEntity {
/** 模版ID列表 */
private List <Long> masterplateIdList;
/** 模版ID排除列表 */
private List <Long> masterplateIdNotList;
/** 开始 收藏时间 */
private String createTimeStart;
/** 结束 收藏时间 */
private String createTimeEnd;
/** 开始 作品类型:1:图片,2:视频 */
private Integer designTypeStart;
/** 结束 作品类型:1:图片,2:视频 */
private Integer designTypeEnd;
/** 增加 作品类型:1:图片,2:视频 */
private Integer designTypeIncrement;
/** 作品类型:1:图片,2:视频列表 */
private List <Integer> designTypeList;
/** 作品类型:1:图片,2:视频排除列表 */
private List <Integer> designTypeNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<CustomerWorkCollectQuery> orConditionList;
......@@ -60,393 +84,606 @@ public class CustomerWorkCollectQuery extends CustomerWorkCollectEntity {
public CustomerWorkCollectQuery(){}
/**
* 获取 开始 主键ID,主键,自增长
* @return idStart
*/
* 获取 开始 主键ID,主键,自增长
* @return idStart
*/
public Long getIdStart(){
return this.idStart;
}
/**
* 设置 开始 主键ID,主键,自增长
* @param idStart
*/
* 设置 开始 主键ID,主键,自增长
* @param idStart
*/
public void setIdStart(Long idStart){
this.idStart = idStart;
}
/**
* 获取 结束 主键ID,主键,自增长
* @return $idEnd
*/
* 获取 结束 主键ID,主键,自增长
* @return $idEnd
*/
public Long getIdEnd(){
return this.idEnd;
}
/**
* 设置 结束 主键ID,主键,自增长
* @param idEnd
*/
* 设置 结束 主键ID,主键,自增长
* @param idEnd
*/
public void setIdEnd(Long idEnd){
this.idEnd = idEnd;
}
/**
* 获取 增加 主键ID,主键,自增长
* @return idIncrement
*/
* 获取 增加 主键ID,主键,自增长
* @return idIncrement
*/
public Long getIdIncrement(){
return this.idIncrement;
}
/**
* 设置 增加 主键ID,主键,自增长
* @param idIncrement
*/
* 设置 增加 主键ID,主键,自增长
* @param idIncrement
*/
public void setIdIncrement(Long idIncrement){
this.idIncrement = idIncrement;
}
/**
* 获取 主键ID,主键,自增长
* @return idList
*/
* 获取 主键ID,主键,自增长
* @return idList
*/
public List<Long> getIdList(){
return this.idList;
}
/**
* 设置 主键ID,主键,自增长
* @param idList
*/
* 设置 主键ID,主键,自增长
* @param idList
*/
public void setIdList(List<Long> idList){
this.idList = idList;
}
/**
* 获取 开始 客户ID
* @return customerIdStart
*/
* 获取 主键ID,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 开始 客户ID
* @return customerIdStart
*/
public Long getCustomerIdStart(){
return this.customerIdStart;
}
/**
* 设置 开始 客户ID
* @param customerIdStart
*/
* 设置 开始 客户ID
* @param customerIdStart
*/
public void setCustomerIdStart(Long customerIdStart){
this.customerIdStart = customerIdStart;
}
/**
* 获取 结束 客户ID
* @return $customerIdEnd
*/
* 获取 结束 客户ID
* @return $customerIdEnd
*/
public Long getCustomerIdEnd(){
return this.customerIdEnd;
}
/**
* 设置 结束 客户ID
* @param customerIdEnd
*/
* 设置 结束 客户ID
* @param customerIdEnd
*/
public void setCustomerIdEnd(Long customerIdEnd){
this.customerIdEnd = customerIdEnd;
}
/**
* 获取 增加 客户ID
* @return customerIdIncrement
*/
* 获取 增加 客户ID
* @return customerIdIncrement
*/
public Long getCustomerIdIncrement(){
return this.customerIdIncrement;
}
/**
* 设置 增加 客户ID
* @param customerIdIncrement
*/
* 设置 增加 客户ID
* @param customerIdIncrement
*/
public void setCustomerIdIncrement(Long customerIdIncrement){
this.customerIdIncrement = customerIdIncrement;
}
/**
* 获取 客户ID
* @return customerIdList
*/
* 获取 客户ID
* @return customerIdList
*/
public List<Long> getCustomerIdList(){
return this.customerIdList;
}
/**
* 设置 客户ID
* @param customerIdList
*/
* 设置 客户ID
* @param customerIdList
*/
public void setCustomerIdList(List<Long> customerIdList){
this.customerIdList = customerIdList;
}
/**
* 获取 开始 模版ID
* @return masterplateIdStart
*/
* 获取 客户ID
* @return customerIdNotList
*/
public List<Long> getCustomerIdNotList(){
return this.customerIdNotList;
}
/**
* 设置 客户ID
* @param customerIdNotList
*/
public void setCustomerIdNotList(List<Long> customerIdNotList){
this.customerIdNotList = customerIdNotList;
}
/**
* 获取 开始 模版ID
* @return masterplateIdStart
*/
public Long getMasterplateIdStart(){
return this.masterplateIdStart;
}
/**
* 设置 开始 模版ID
* @param masterplateIdStart
*/
* 设置 开始 模版ID
* @param masterplateIdStart
*/
public void setMasterplateIdStart(Long masterplateIdStart){
this.masterplateIdStart = masterplateIdStart;
}
/**
* 获取 结束 模版ID
* @return $masterplateIdEnd
*/
* 获取 结束 模版ID
* @return $masterplateIdEnd
*/
public Long getMasterplateIdEnd(){
return this.masterplateIdEnd;
}
/**
* 设置 结束 模版ID
* @param masterplateIdEnd
*/
* 设置 结束 模版ID
* @param masterplateIdEnd
*/
public void setMasterplateIdEnd(Long masterplateIdEnd){
this.masterplateIdEnd = masterplateIdEnd;
}
/**
* 获取 增加 模版ID
* @return masterplateIdIncrement
*/
* 获取 增加 模版ID
* @return masterplateIdIncrement
*/
public Long getMasterplateIdIncrement(){
return this.masterplateIdIncrement;
}
/**
* 设置 增加 模版ID
* @param masterplateIdIncrement
*/
* 设置 增加 模版ID
* @param masterplateIdIncrement
*/
public void setMasterplateIdIncrement(Long masterplateIdIncrement){
this.masterplateIdIncrement = masterplateIdIncrement;
}
/**
* 获取 模版ID
* @return masterplateIdList
*/
* 获取 模版ID
* @return masterplateIdList
*/
public List<Long> getMasterplateIdList(){
return this.masterplateIdList;
}
/**
* 设置 模版ID
* @param masterplateIdList
*/
* 设置 模版ID
* @param masterplateIdList
*/
public void setMasterplateIdList(List<Long> masterplateIdList){
this.masterplateIdList = masterplateIdList;
}
/**
* 获取 开始 收藏时间
* @return createTimeStart
*/
* 获取 模版ID
* @return masterplateIdNotList
*/
public List<Long> getMasterplateIdNotList(){
return this.masterplateIdNotList;
}
/**
* 设置 模版ID
* @param masterplateIdNotList
*/
public void setMasterplateIdNotList(List<Long> masterplateIdNotList){
this.masterplateIdNotList = masterplateIdNotList;
}
/**
* 获取 开始 收藏时间
* @return createTimeStart
*/
public String getCreateTimeStart(){
return this.createTimeStart;
}
/**
* 设置 开始 收藏时间
* @param createTimeStart
*/
* 设置 开始 收藏时间
* @param createTimeStart
*/
public void setCreateTimeStart(String createTimeStart){
this.createTimeStart = createTimeStart;
}
/**
* 获取 结束 收藏时间
* @return createTimeEnd
*/
* 获取 结束 收藏时间
* @return createTimeEnd
*/
public String getCreateTimeEnd(){
return this.createTimeEnd;
}
/**
* 设置 结束 收藏时间
* @param createTimeEnd
*/
* 设置 结束 收藏时间
* @param createTimeEnd
*/
public void setCreateTimeEnd(String createTimeEnd){
this.createTimeEnd = createTimeEnd;
}
/**
* 设置 主键ID,主键,自增长
* @param id
*/
* 获取 开始 作品类型:1:图片,2:视频
* @return designTypeStart
*/
public Integer getDesignTypeStart(){
return this.designTypeStart;
}
/**
* 设置 开始 作品类型:1:图片,2:视频
* @param designTypeStart
*/
public void setDesignTypeStart(Integer designTypeStart){
this.designTypeStart = designTypeStart;
}
/**
* 获取 结束 作品类型:1:图片,2:视频
* @return $designTypeEnd
*/
public Integer getDesignTypeEnd(){
return this.designTypeEnd;
}
/**
* 设置 结束 作品类型:1:图片,2:视频
* @param designTypeEnd
*/
public void setDesignTypeEnd(Integer designTypeEnd){
this.designTypeEnd = designTypeEnd;
}
/**
* 获取 增加 作品类型:1:图片,2:视频
* @return designTypeIncrement
*/
public Integer getDesignTypeIncrement(){
return this.designTypeIncrement;
}
/**
* 设置 增加 作品类型:1:图片,2:视频
* @param designTypeIncrement
*/
public void setDesignTypeIncrement(Integer designTypeIncrement){
this.designTypeIncrement = designTypeIncrement;
}
/**
* 获取 作品类型:1:图片,2:视频
* @return designTypeList
*/
public List<Integer> getDesignTypeList(){
return this.designTypeList;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeList
*/
public void setDesignTypeList(List<Integer> designTypeList){
this.designTypeList = designTypeList;
}
/**
* 获取 作品类型:1:图片,2:视频
* @return designTypeNotList
*/
public List<Integer> getDesignTypeNotList(){
return this.designTypeNotList;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeNotList
*/
public void setDesignTypeNotList(List<Integer> designTypeNotList){
this.designTypeNotList = designTypeNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
*/
public CustomerWorkCollectQuery id(Long id){
setId(id);
return this;
}
/**
* 设置 开始 主键ID,主键,自增长
* @param idStart
*/
setId(id);
return this;
}
/**
* 设置 开始 主键ID,主键,自增长
* @param idStart
*/
public CustomerWorkCollectQuery idStart(Long idStart){
this.idStart = idStart;
return this;
this.idStart = idStart;
return this;
}
/**
* 设置 结束 主键ID,主键,自增长
* @param idEnd
*/
* 设置 结束 主键ID,主键,自增长
* @param idEnd
*/
public CustomerWorkCollectQuery idEnd(Long idEnd){
this.idEnd = idEnd;
return this;
this.idEnd = idEnd;
return this;
}
/**
* 设置 增加 主键ID,主键,自增长
* @param idIncrement
*/
* 设置 增加 主键ID,主键,自增长
* @param idIncrement
*/
public CustomerWorkCollectQuery idIncrement(Long idIncrement){
this.idIncrement = idIncrement;
return this;
this.idIncrement = idIncrement;
return this;
}
/**
* 设置 主键ID,主键,自增长
* @param idList
*/
* 设置 主键ID,主键,自增长
* @param idList
*/
public CustomerWorkCollectQuery idList(List<Long> idList){
this.idList = idList;
return this;
}
return this;
}
/**
* 设置 客户ID
* @param customerId
*/
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public CustomerWorkCollectQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 客户ID
* @param customerId
*/
public CustomerWorkCollectQuery customerId(Long customerId){
setCustomerId(customerId);
return this;
}
/**
* 设置 开始 客户ID
* @param customerIdStart
*/
setCustomerId(customerId);
return this;
}
/**
* 设置 开始 客户ID
* @param customerIdStart
*/
public CustomerWorkCollectQuery customerIdStart(Long customerIdStart){
this.customerIdStart = customerIdStart;
return this;
this.customerIdStart = customerIdStart;
return this;
}
/**
* 设置 结束 客户ID
* @param customerIdEnd
*/
* 设置 结束 客户ID
* @param customerIdEnd
*/
public CustomerWorkCollectQuery customerIdEnd(Long customerIdEnd){
this.customerIdEnd = customerIdEnd;
return this;
this.customerIdEnd = customerIdEnd;
return this;
}
/**
* 设置 增加 客户ID
* @param customerIdIncrement
*/
* 设置 增加 客户ID
* @param customerIdIncrement
*/
public CustomerWorkCollectQuery customerIdIncrement(Long customerIdIncrement){
this.customerIdIncrement = customerIdIncrement;
return this;
this.customerIdIncrement = customerIdIncrement;
return this;
}
/**
* 设置 客户ID
* @param customerIdList
*/
* 设置 客户ID
* @param customerIdList
*/
public CustomerWorkCollectQuery customerIdList(List<Long> customerIdList){
this.customerIdList = customerIdList;
return this;
}
return this;
}
/**
* 设置 客户ID
* @param customerIdNotList
*/
public CustomerWorkCollectQuery customerIdNotList(List<Long> customerIdNotList){
this.customerIdNotList = customerIdNotList;
return this;
}
/**
* 设置 模版ID
* @param masterplateId
*/
* 设置 模版ID
* @param masterplateId
*/
public CustomerWorkCollectQuery masterplateId(Long masterplateId){
setMasterplateId(masterplateId);
return this;
}
/**
* 设置 开始 模版ID
* @param masterplateIdStart
*/
setMasterplateId(masterplateId);
return this;
}
/**
* 设置 开始 模版ID
* @param masterplateIdStart
*/
public CustomerWorkCollectQuery masterplateIdStart(Long masterplateIdStart){
this.masterplateIdStart = masterplateIdStart;
return this;
this.masterplateIdStart = masterplateIdStart;
return this;
}
/**
* 设置 结束 模版ID
* @param masterplateIdEnd
*/
* 设置 结束 模版ID
* @param masterplateIdEnd
*/
public CustomerWorkCollectQuery masterplateIdEnd(Long masterplateIdEnd){
this.masterplateIdEnd = masterplateIdEnd;
return this;
this.masterplateIdEnd = masterplateIdEnd;
return this;
}
/**
* 设置 增加 模版ID
* @param masterplateIdIncrement
*/
* 设置 增加 模版ID
* @param masterplateIdIncrement
*/
public CustomerWorkCollectQuery masterplateIdIncrement(Long masterplateIdIncrement){
this.masterplateIdIncrement = masterplateIdIncrement;
return this;
this.masterplateIdIncrement = masterplateIdIncrement;
return this;
}
/**
* 设置 模版ID
* @param masterplateIdList
*/
* 设置 模版ID
* @param masterplateIdList
*/
public CustomerWorkCollectQuery masterplateIdList(List<Long> masterplateIdList){
this.masterplateIdList = masterplateIdList;
return this;
}
return this;
}
/**
* 设置 模版ID
* @param masterplateIdNotList
*/
public CustomerWorkCollectQuery masterplateIdNotList(List<Long> masterplateIdNotList){
this.masterplateIdNotList = masterplateIdNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
*/
* 设置 作品类型:1:图片,2:视频
* @param designType
*/
public CustomerWorkCollectQuery designType(Integer designType){
setDesignType(designType);
return this;
}
/**
* 设置 开始 作品类型:1:图片,2:视频
* @param designTypeStart
*/
public CustomerWorkCollectQuery designTypeStart(Integer designTypeStart){
this.designTypeStart = designTypeStart;
return this;
}
/**
* 设置 结束 作品类型:1:图片,2:视频
* @param designTypeEnd
*/
public CustomerWorkCollectQuery designTypeEnd(Integer designTypeEnd){
this.designTypeEnd = designTypeEnd;
return this;
}
/**
* 设置 增加 作品类型:1:图片,2:视频
* @param designTypeIncrement
*/
public CustomerWorkCollectQuery designTypeIncrement(Integer designTypeIncrement){
this.designTypeIncrement = designTypeIncrement;
return this;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeList
*/
public CustomerWorkCollectQuery designTypeList(List<Integer> designTypeList){
this.designTypeList = designTypeList;
return this;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeNotList
*/
public CustomerWorkCollectQuery designTypeNotList(List<Integer> designTypeNotList){
this.designTypeNotList = designTypeNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
*/
public List<CustomerWorkCollectQuery> getOrConditionList(){
return this.orConditionList;
return this.orConditionList;
}
/**
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @param orConditionList
*/
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @param orConditionList
*/
public void setOrConditionList(List<CustomerWorkCollectQuery> orConditionList){
this.orConditionList = orConditionList;
}
/**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList
*/
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList
*/
public List<CustomerWorkCollectQuery> getAndConditionList(){
return this.andConditionList;
}
/**
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @param andConditionList
*/
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @param andConditionList
*/
public void setAndConditionList(List<CustomerWorkCollectQuery> andConditionList){
this.andConditionList = andConditionList;
}
......
package com.mortals.xhx.module.customer.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.customer.model.vo.CustomerWorkDesignVo;
import lombok.Data;
/**
* 客户作品信息实体对象
*
* @author zxfei
* @date 2022-07-08
* @date 2023-07-11
*/
@Data
public class CustomerWorkDesignEntity extends CustomerWorkDesignVo {
private static final long serialVersionUID = 1L;
......@@ -56,154 +56,10 @@ public class CustomerWorkDesignEntity extends CustomerWorkDesignVo {
* 设计草稿
*/
private String draft;
public CustomerWorkDesignEntity(){}
/**
* 获取 客户ID
* @return Long
*/
public Long getCustomerId(){
return customerId;
}
/**
* 设置 客户ID
* @param customerId
*/
public void setCustomerId(Long customerId){
this.customerId = customerId;
}
/**
* 获取 作品名称
* @return String
*/
public String getWorkDesignName(){
return workDesignName;
}
/**
* 设置 作品名称
* @param workDesignName
*/
public void setWorkDesignName(String workDesignName){
this.workDesignName = workDesignName;
}
/**
* 获取 作品状态:0:草稿,1:发布
* @return Integer
*/
public Integer getWorkDesignStatus(){
return workDesignStatus;
}
/**
* 设置 作品状态:0:草稿,1:发布
* @param workDesignStatus
*/
public void setWorkDesignStatus(Integer workDesignStatus){
this.workDesignStatus = workDesignStatus;
}
/**
* 获取 作品描述
* @return String
*/
public String getWorkDesignDesc(){
return workDesignDesc;
}
/**
* 设置 作品描述
* @param workDesignDesc
*/
public void setWorkDesignDesc(String workDesignDesc){
this.workDesignDesc = workDesignDesc;
}
/**
* 获取 模版引用的图片
* @return String
*/
public String getPictureIds(){
return pictureIds;
}
/**
* 设置 模版引用的图片
* @param pictureIds
*/
public void setPictureIds(String pictureIds){
this.pictureIds = pictureIds;
}
/**
* 获取 模版引用的素材
* @return String
* 作品类型:1:图片,2:视频
*/
public String getPictureSrcIds(){
return pictureSrcIds;
}
/**
* 设置 模版引用的素材
* @param pictureSrcIds
*/
public void setPictureSrcIds(String pictureSrcIds){
this.pictureSrcIds = pictureSrcIds;
}
/**
* 获取 模版引用的背景
* @return String
*/
public String getPictureBackgroundIds(){
return pictureBackgroundIds;
}
/**
* 设置 模版引用的背景
* @param pictureBackgroundIds
*/
public void setPictureBackgroundIds(String pictureBackgroundIds){
this.pictureBackgroundIds = pictureBackgroundIds;
}
/**
* 获取 作品引用的字体
* @return String
*/
public String getFontIds(){
return fontIds;
}
/**
* 设置 作品引用的字体
* @param fontIds
*/
public void setFontIds(String fontIds){
this.fontIds = fontIds;
}
/**
* 获取 作品图片预览地址(相对地址)
* @return String
*/
public String getPreviewUrl(){
return previewUrl;
}
/**
* 设置 作品图片预览地址(相对地址)
* @param previewUrl
*/
public void setPreviewUrl(String previewUrl){
this.previewUrl = previewUrl;
}
/**
* 获取 设计草稿
* @return String
*/
public String getDraft(){
return draft;
}
/**
* 设置 设计草稿
* @param draft
*/
public void setDraft(String draft){
this.draft = draft;
}
private Integer designType;
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -220,28 +76,13 @@ public class CustomerWorkDesignEntity extends CustomerWorkDesignVo {
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",customerId:").append(getCustomerId());
sb.append(",workDesignName:").append(getWorkDesignName());
sb.append(",workDesignStatus:").append(getWorkDesignStatus());
sb.append(",workDesignDesc:").append(getWorkDesignDesc());
sb.append(",pictureIds:").append(getPictureIds());
sb.append(",pictureSrcIds:").append(getPictureSrcIds());
sb.append(",pictureBackgroundIds:").append(getPictureBackgroundIds());
sb.append(",fontIds:").append(getFontIds());
sb.append(",previewUrl:").append(getPreviewUrl());
sb.append(",draft:").append(getDraft());
return sb.toString();
}
public void initAttrValue(){
this.customerId = null;
this.workDesignName = "";
this.workDesignStatus = null;
this.workDesignStatus = -1;
this.workDesignDesc = "";
......@@ -256,5 +97,7 @@ public class CustomerWorkDesignEntity extends CustomerWorkDesignVo {
this.previewUrl = "";
this.draft = "";
this.designType = 1;
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ import com.mortals.xhx.module.customer.model.CustomerWorkDesignEntity;
* 客户作品信息查询对象
*
* @author zxfei
* @date 2022-07-08
* @date 2023-07-11
*/
public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
/** 开始 主键ID,主键,自增长 */
......@@ -21,6 +21,9 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/** 主键ID,主键,自增长排除列表 */
private List <Long> idNotList;
/** 开始 客户ID */
private Long customerIdStart;
......@@ -33,9 +36,14 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
/** 客户ID列表 */
private List <Long> customerIdList;
/** 客户ID排除列表 */
private List <Long> customerIdNotList;
/** 作品名称 */
private List<String> workDesignNameList;
/** 作品名称排除列表 */
private List <String> workDesignNameNotList;
/** 开始 作品状态:0:草稿,1:发布 */
private Integer workDesignStatusStart;
......@@ -48,9 +56,14 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
/** 作品状态:0:草稿,1:发布列表 */
private List <Integer> workDesignStatusList;
/** 作品状态:0:草稿,1:发布排除列表 */
private List <Integer> workDesignStatusNotList;
/** 作品描述 */
private List<String> workDesignDescList;
/** 作品描述排除列表 */
private List <String> workDesignDescNotList;
/** 开始 创建时间 */
private String createTimeStart;
......@@ -66,21 +79,48 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
/** 模版引用的图片 */
private List<String> pictureIdsList;
/** 模版引用的图片排除列表 */
private List <String> pictureIdsNotList;
/** 模版引用的素材 */
private List<String> pictureSrcIdsList;
/** 模版引用的素材排除列表 */
private List <String> pictureSrcIdsNotList;
/** 模版引用的背景 */
private List<String> pictureBackgroundIdsList;
/** 模版引用的背景排除列表 */
private List <String> pictureBackgroundIdsNotList;
/** 作品引用的字体 */
private List<String> fontIdsList;
/** 作品引用的字体排除列表 */
private List <String> fontIdsNotList;
/** 作品图片预览地址(相对地址) */
private List<String> previewUrlList;
/** 作品图片预览地址(相对地址)排除列表 */
private List <String> previewUrlNotList;
/** 设计草稿 */
private List<String> draftList;
/** 设计草稿排除列表 */
private List <String> draftNotList;
/** 开始 作品类型:1:图片,2:视频 */
private Integer designTypeStart;
/** 结束 作品类型:1:图片,2:视频 */
private Integer designTypeEnd;
/** 增加 作品类型:1:图片,2:视频 */
private Integer designTypeIncrement;
/** 作品类型:1:图片,2:视频列表 */
private List <Integer> designTypeList;
/** 作品类型:1:图片,2:视频排除列表 */
private List <Integer> designTypeNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<CustomerWorkDesignQuery> orConditionList;
......@@ -153,6 +193,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
this.idList = idList;
}
/**
* 获取 主键ID,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 开始 客户ID
* @return customerIdStart
......@@ -217,6 +274,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
this.customerIdList = customerIdList;
}
/**
* 获取 客户ID
* @return customerIdNotList
*/
public List<Long> getCustomerIdNotList(){
return this.customerIdNotList;
}
/**
* 设置 客户ID
* @param customerIdNotList
*/
public void setCustomerIdNotList(List<Long> customerIdNotList){
this.customerIdNotList = customerIdNotList;
}
/**
* 获取 作品名称
* @return workDesignNameList
......@@ -232,6 +306,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
public void setWorkDesignNameList(List<String> workDesignNameList){
this.workDesignNameList = workDesignNameList;
}
/**
* 获取 作品名称
* @return workDesignNameNotList
*/
public List<String> getWorkDesignNameNotList(){
return this.workDesignNameNotList;
}
/**
* 设置 作品名称
* @param workDesignNameNotList
*/
public void setWorkDesignNameNotList(List<String> workDesignNameNotList){
this.workDesignNameNotList = workDesignNameNotList;
}
/**
* 获取 开始 作品状态:0:草稿,1:发布
* @return workDesignStatusStart
......@@ -296,6 +387,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
this.workDesignStatusList = workDesignStatusList;
}
/**
* 获取 作品状态:0:草稿,1:发布
* @return workDesignStatusNotList
*/
public List<Integer> getWorkDesignStatusNotList(){
return this.workDesignStatusNotList;
}
/**
* 设置 作品状态:0:草稿,1:发布
* @param workDesignStatusNotList
*/
public void setWorkDesignStatusNotList(List<Integer> workDesignStatusNotList){
this.workDesignStatusNotList = workDesignStatusNotList;
}
/**
* 获取 作品描述
* @return workDesignDescList
......@@ -311,6 +419,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
public void setWorkDesignDescList(List<String> workDesignDescList){
this.workDesignDescList = workDesignDescList;
}
/**
* 获取 作品描述
* @return workDesignDescNotList
*/
public List<String> getWorkDesignDescNotList(){
return this.workDesignDescNotList;
}
/**
* 设置 作品描述
* @param workDesignDescNotList
*/
public void setWorkDesignDescNotList(List<String> workDesignDescNotList){
this.workDesignDescNotList = workDesignDescNotList;
}
/**
* 获取 开始 创建时间
* @return createTimeStart
......@@ -390,6 +515,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
public void setPictureIdsList(List<String> pictureIdsList){
this.pictureIdsList = pictureIdsList;
}
/**
* 获取 模版引用的图片
* @return pictureIdsNotList
*/
public List<String> getPictureIdsNotList(){
return this.pictureIdsNotList;
}
/**
* 设置 模版引用的图片
* @param pictureIdsNotList
*/
public void setPictureIdsNotList(List<String> pictureIdsNotList){
this.pictureIdsNotList = pictureIdsNotList;
}
/**
* 获取 模版引用的素材
* @return pictureSrcIdsList
......@@ -405,6 +547,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
public void setPictureSrcIdsList(List<String> pictureSrcIdsList){
this.pictureSrcIdsList = pictureSrcIdsList;
}
/**
* 获取 模版引用的素材
* @return pictureSrcIdsNotList
*/
public List<String> getPictureSrcIdsNotList(){
return this.pictureSrcIdsNotList;
}
/**
* 设置 模版引用的素材
* @param pictureSrcIdsNotList
*/
public void setPictureSrcIdsNotList(List<String> pictureSrcIdsNotList){
this.pictureSrcIdsNotList = pictureSrcIdsNotList;
}
/**
* 获取 模版引用的背景
* @return pictureBackgroundIdsList
......@@ -420,6 +579,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
public void setPictureBackgroundIdsList(List<String> pictureBackgroundIdsList){
this.pictureBackgroundIdsList = pictureBackgroundIdsList;
}
/**
* 获取 模版引用的背景
* @return pictureBackgroundIdsNotList
*/
public List<String> getPictureBackgroundIdsNotList(){
return this.pictureBackgroundIdsNotList;
}
/**
* 设置 模版引用的背景
* @param pictureBackgroundIdsNotList
*/
public void setPictureBackgroundIdsNotList(List<String> pictureBackgroundIdsNotList){
this.pictureBackgroundIdsNotList = pictureBackgroundIdsNotList;
}
/**
* 获取 作品引用的字体
* @return fontIdsList
......@@ -435,6 +611,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
public void setFontIdsList(List<String> fontIdsList){
this.fontIdsList = fontIdsList;
}
/**
* 获取 作品引用的字体
* @return fontIdsNotList
*/
public List<String> getFontIdsNotList(){
return this.fontIdsNotList;
}
/**
* 设置 作品引用的字体
* @param fontIdsNotList
*/
public void setFontIdsNotList(List<String> fontIdsNotList){
this.fontIdsNotList = fontIdsNotList;
}
/**
* 获取 作品图片预览地址(相对地址)
* @return previewUrlList
......@@ -450,6 +643,23 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
public void setPreviewUrlList(List<String> previewUrlList){
this.previewUrlList = previewUrlList;
}
/**
* 获取 作品图片预览地址(相对地址)
* @return previewUrlNotList
*/
public List<String> getPreviewUrlNotList(){
return this.previewUrlNotList;
}
/**
* 设置 作品图片预览地址(相对地址)
* @param previewUrlNotList
*/
public void setPreviewUrlNotList(List<String> previewUrlNotList){
this.previewUrlNotList = previewUrlNotList;
}
/**
* 获取 设计草稿
* @return draftList
......@@ -465,6 +675,104 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
public void setDraftList(List<String> draftList){
this.draftList = draftList;
}
/**
* 获取 设计草稿
* @return draftNotList
*/
public List<String> getDraftNotList(){
return this.draftNotList;
}
/**
* 设置 设计草稿
* @param draftNotList
*/
public void setDraftNotList(List<String> draftNotList){
this.draftNotList = draftNotList;
}
/**
* 获取 开始 作品类型:1:图片,2:视频
* @return designTypeStart
*/
public Integer getDesignTypeStart(){
return this.designTypeStart;
}
/**
* 设置 开始 作品类型:1:图片,2:视频
* @param designTypeStart
*/
public void setDesignTypeStart(Integer designTypeStart){
this.designTypeStart = designTypeStart;
}
/**
* 获取 结束 作品类型:1:图片,2:视频
* @return $designTypeEnd
*/
public Integer getDesignTypeEnd(){
return this.designTypeEnd;
}
/**
* 设置 结束 作品类型:1:图片,2:视频
* @param designTypeEnd
*/
public void setDesignTypeEnd(Integer designTypeEnd){
this.designTypeEnd = designTypeEnd;
}
/**
* 获取 增加 作品类型:1:图片,2:视频
* @return designTypeIncrement
*/
public Integer getDesignTypeIncrement(){
return this.designTypeIncrement;
}
/**
* 设置 增加 作品类型:1:图片,2:视频
* @param designTypeIncrement
*/
public void setDesignTypeIncrement(Integer designTypeIncrement){
this.designTypeIncrement = designTypeIncrement;
}
/**
* 获取 作品类型:1:图片,2:视频
* @return designTypeList
*/
public List<Integer> getDesignTypeList(){
return this.designTypeList;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeList
*/
public void setDesignTypeList(List<Integer> designTypeList){
this.designTypeList = designTypeList;
}
/**
* 获取 作品类型:1:图片,2:视频
* @return designTypeNotList
*/
public List<Integer> getDesignTypeNotList(){
return this.designTypeNotList;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeNotList
*/
public void setDesignTypeNotList(List<Integer> designTypeNotList){
this.designTypeNotList = designTypeNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
......@@ -510,6 +818,15 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
return this;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public CustomerWorkDesignQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 客户ID
* @param customerId
......@@ -555,6 +872,15 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
return this;
}
/**
* 设置 客户ID
* @param customerIdNotList
*/
public CustomerWorkDesignQuery customerIdNotList(List<Long> customerIdNotList){
this.customerIdNotList = customerIdNotList;
return this;
}
/**
* 设置 作品名称
......@@ -619,6 +945,15 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
return this;
}
/**
* 设置 作品状态:0:草稿,1:发布
* @param workDesignStatusNotList
*/
public CustomerWorkDesignQuery workDesignStatusNotList(List<Integer> workDesignStatusNotList){
this.workDesignStatusNotList = workDesignStatusNotList;
return this;
}
/**
* 设置 作品描述
......@@ -754,6 +1089,60 @@ public class CustomerWorkDesignQuery extends CustomerWorkDesignEntity {
return this;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designType
*/
public CustomerWorkDesignQuery designType(Integer designType){
setDesignType(designType);
return this;
}
/**
* 设置 开始 作品类型:1:图片,2:视频
* @param designTypeStart
*/
public CustomerWorkDesignQuery designTypeStart(Integer designTypeStart){
this.designTypeStart = designTypeStart;
return this;
}
/**
* 设置 结束 作品类型:1:图片,2:视频
* @param designTypeEnd
*/
public CustomerWorkDesignQuery designTypeEnd(Integer designTypeEnd){
this.designTypeEnd = designTypeEnd;
return this;
}
/**
* 设置 增加 作品类型:1:图片,2:视频
* @param designTypeIncrement
*/
public CustomerWorkDesignQuery designTypeIncrement(Integer designTypeIncrement){
this.designTypeIncrement = designTypeIncrement;
return this;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeList
*/
public CustomerWorkDesignQuery designTypeList(List<Integer> designTypeList){
this.designTypeList = designTypeList;
return this;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeNotList
*/
public CustomerWorkDesignQuery designTypeNotList(List<Integer> designTypeNotList){
this.designTypeNotList = designTypeNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
package com.mortals.xhx.module.customer.model.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 客户管理视图对象
......@@ -38,4 +40,27 @@ public class CustomerVo extends BaseEntityLong {
private String oldPassword;
private String newPassword;
/**
* 客户设计图片数量
*/
@Excel(name = "图片作品数")
private Integer customerDesignPictures;
/**
* 客户设计视频数量
*/
@Excel(name = "视频作品数")
private Integer customerDesignVideos;
@Excel(name = "会员等级")
private String levelName;
@Excel(name = "使用状态")
private String statusName;
/**
* 最后一次登录时间
*/
@Excel(name = "最近登录时间")
private String lastLoginTimeStr;
}
\ No newline at end of file
......@@ -8,6 +8,8 @@ import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import com.mortals.xhx.module.customer.model.CustomerEntityExt;
import java.util.Map;
/**
* CustomerService
*
......@@ -57,4 +59,36 @@ public interface CustomerService extends ICRUDService<CustomerEntity,Long>{
* @throws AppException
*/
void changePasswordByAdmin(CustomerEntity params, Context context) throws AppException;
/**
* 用户情况统计
* @return
*/
Map<String,Object> getCustomerCensus();
/**
* 发送手机验证码
* @param mobileNumber
* @throws AppException
*/
void sendSmsVerifyCode(String mobileNumber) throws AppException;
/**
* 手机验证码登录
* @param mobileNumber
* @param verifyCode
* @param loginIp
* @return
* @throws AppException
*/
CustomerEntity doSmsLogin(String mobileNumber, String verifyCode, String loginIp) throws AppException;
/**
* 微信扫码登录
* @param openId
* @param loginIp
* @return
* @throws AppException
*/
CustomerEntity doWeChatLogin(String openId, String loginIp) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.customer.service.impl;
import cn.hutool.core.util.DesensitizedUtil;
import cn.hutool.core.util.PhoneUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.SecurityUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.util.*;
import com.mortals.xhx.common.code.CustomerSatusEnum;
import com.mortals.xhx.common.code.UserStatus;
import com.mortals.xhx.module.customer.dao.CustomerDao;
import com.mortals.xhx.module.customer.dao.CustomerPwdRecordDao;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import com.mortals.xhx.module.customer.model.CustomerEntityExt;
import com.mortals.xhx.module.customer.model.CustomerPwdRecordEntity;
import com.mortals.xhx.module.customer.model.CustomerQuery;
import com.mortals.xhx.module.customer.model.vo.CustomerCensusVo;
import com.mortals.xhx.module.customer.model.vo.CustomerDesignCensusVo;
import com.mortals.xhx.module.customer.service.CustomerService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
* CustomerService
......@@ -34,6 +39,21 @@ import java.util.List;
@Service("customerService")
public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, CustomerEntity, Long> implements CustomerService {
@Value("${sms.apiUrl:http://sms.wx3.com.cn/api/index/index}")
private String smsApiUrl;
@Value("${sms.appid:ADsUXLrS81vZDU95}")
private String appid;
/** 短信模板ID**/
private static String SMS_TPYE = "30";
private static String SMS_VERIFY_CODE_KEY ="login:sms:verify:";
@Autowired
private ICacheService cacheService;
@Autowired
private CustomerPwdRecordDao customerPwdRecordDao;
@Override
protected void saveBefore(CustomerEntity entity, Context context) throws AppException {
this.validData(entity, context);
......@@ -54,7 +74,11 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
}
if (StringUtils.isNotEmpty(entity.getPassword())) {
try {
entity.setPassword(SecurityUtil.md5DoubleEncoding(entity.getPassword()));
String saltKey = SecurityCode.getSecurityCode(6,SecurityCode.SecurityCodeLevel.Medium,false);
String newPwd = entity.getPassword() + saltKey;
newPwd = SecurityUtil.md5DoubleEncoding(newPwd);
entity.setPassword(newPwd);
entity.setSaltKey(saltKey);
} catch (Exception e) {
throw new AppException("密码转换异常");
}
......@@ -93,6 +117,8 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
if(CollectionUtils.isNotEmpty(list)){
list.stream().forEach(item->{
item.setCreateTimeStr(DateUtils.getDateTime(item.getCreateTime(),DateUtils.P_yyyy_MM_dd_HH_mm_ss));
item.setContactTelphone(DesensitizedUtil.mobilePhone(item.getContactTelphone()));
item.setCustName(DesensitizedUtil.chineseName(item.getCustName()));
});
}
return result;
......@@ -107,9 +133,41 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
if(user.getStatus()!= CustomerSatusEnum.NORMAL.getValue()){
throw new AppException("该账号已被禁用!");
}
if(user.getErrorCount()==null){
user.setErrorCount(0);
}
if(user.getLoginLock()==null){
user.setLoginLock(0);
}
if(user.getLoginLock() == 1 && user.getLockTime()!=null){
String nowStr = DateUtils.getCurrStrDate();
String loginDateStr = DateUtils.getDateTime(user.getLockTime(),"yyyy-MM-dd");
if(nowStr.equals(loginDateStr)) {
throw new AppException("此账号当天密码错误次数已达上限,已被锁定");
}
}
try {
if(StringUtils.isNotEmpty(user.getSaltKey())) {
password += user.getSaltKey();
}
if (!user.getPassword().equals(SecurityUtil.md5DoubleEncoding(password))) {
CustomerEntity update = new CustomerEntity();
update.setId(user.getId());
update.setErrorCount(user.getErrorCount()+1);
if(update.getErrorCount()==5){
update.setLoginLock(1);
update.setLockTime(new Date());
}
this.dao.update(update);
throw new AppException("登录密码错误!");
}else {
if(user.getLastUpdatePwdTime()!=null) {
long day = DateUtils.getBetween(user.getLastUpdatePwdTime(), new Date(), 2);
if (day >= 90) {
throw new AppException("密码已超过三个月没有更改,请修改以后再登录");
}
}
}
} catch (Exception e) {
throw new AppException("密码验认出错!", e);
......@@ -130,6 +188,16 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
@Override
public CustomerEntity updateByPersonal(CustomerEntity params, Context context) throws AppException {
CustomerEntity old = this.get(params.getId());
if(old==null){
throw new AppException("用户Id不正确!");
}
if(!old.getLoginName().equals(params.getLoginName())) {
CustomerEntity user = this.findByLoginName(params.getLoginName());
if (user != null) {
throw new AppException("用户名已存在!");
}
}
CustomerEntity update = new CustomerEntity();
update.setId(params.getId());
update.setLoginName(params.getLoginName());
......@@ -140,6 +208,7 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
update.setContactTelphone(params.getContactTelphone());
update.setMailbox(params.getMailbox());
update.setJob(params.getJob());
update.setOpenId(params.getOpenId());
int iRet = this.dao.update(update);
if (iRet == 0) {
throw new AppException(-1002, "更新失败!");
......@@ -163,9 +232,17 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
}
String newPwd = "";
String oldPwd = "";
String saltKey = "";
try {
oldPwd = SecurityUtil.md5DoubleEncoding(params.getOldPassword());
newPwd = SecurityUtil.md5DoubleEncoding(params.getNewPassword());
if(StringUtils.isNotEmpty(old.getSaltKey())) {
oldPwd = params.getOldPassword()+old.getSaltKey();
}else {
oldPwd = params.getOldPassword();
}
oldPwd = SecurityUtil.md5DoubleEncoding(oldPwd);
saltKey = SecurityCode.getSecurityCode(6,SecurityCode.SecurityCodeLevel.Medium,false);
newPwd = params.getNewPassword() + saltKey;
newPwd = SecurityUtil.md5DoubleEncoding(newPwd);
}catch (Exception e) {
throw new AppException("密码转换异常");
}
......@@ -173,8 +250,16 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
CustomerEntity update = new CustomerEntity();
update.setId(params.getId());
update.setPassword(newPwd);
update.setSaltKey(saltKey);
this.update(update,context);
old.setPassword(null);
CustomerPwdRecordEntity userPwdRecordEntity = new CustomerPwdRecordEntity();
userPwdRecordEntity.setUserId(old.getId());
userPwdRecordEntity.setLoginName(old.getLoginName());
userPwdRecordEntity.setLoginPwd(newPwd);
userPwdRecordEntity.setCreateTime(new Date());
userPwdRecordEntity.setCreateUserId(context.getUser().getId());
customerPwdRecordDao.insert(userPwdRecordEntity);
}else {
throw new AppException("原来的密码不正确");
}
......@@ -188,15 +273,162 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
throw new AppException("客户信息不存在");
}
String newPwd = "";
String oldPwd = "";
String saltKey = "";
try {
newPwd = SecurityUtil.md5DoubleEncoding(params.getNewPassword());
saltKey = SecurityCode.getSecurityCode(6,SecurityCode.SecurityCodeLevel.Medium,false);
newPwd = params.getNewPassword() + saltKey;
newPwd = SecurityUtil.md5DoubleEncoding(newPwd);
}catch (Exception e) {
throw new AppException("密码转换异常");
}
CustomerEntity update = new CustomerEntity();
update.setId(params.getId());
update.setPassword(newPwd);
update.setSaltKey(saltKey);
this.update(update,context);
CustomerPwdRecordEntity userPwdRecordEntity = new CustomerPwdRecordEntity();
userPwdRecordEntity.setUserId(old.getId());
userPwdRecordEntity.setLoginName(old.getLoginName());
userPwdRecordEntity.setLoginPwd(newPwd);
userPwdRecordEntity.setCreateTime(new Date());
userPwdRecordEntity.setCreateUserId(context.getUser().getId());
customerPwdRecordDao.insert(userPwdRecordEntity);
}
@Override
public Map<String, Object> getCustomerCensus() {
Map<String, Object> result = new HashMap<>();
List<CustomerCensusVo> customerCensusVos = dao.getCensus();
CustomerDesignCensusVo designCensusVo = dao.getDesignCensus();
if(CollectionUtils.isNotEmpty(customerCensusVos)){
for(CustomerCensusVo item:customerCensusVos){
if(item.getMemberLevel()==1){
result.put("trial",item.getCustomerCount());
}
if(item.getMemberLevel()==2){
result.put("vip",item.getCustomerCount());
}
if(item.getMemberLevel()==3){
result.put("designer",item.getCustomerCount());
}
}
}
result.put("picturesCount",designCensusVo.getPicturesCount());
result.put("videosCount",designCensusVo.getVideosCount());
return result;
}
@Override
public void sendSmsVerifyCode(String mobileNumber) throws AppException {
if(StringUtils.isEmpty(mobileNumber)){
throw new AppException("手机号不能为空");
}
if(!PhoneUtil.isPhone(mobileNumber)){
throw new AppException("手机号码格式不正确");
}
CustomerEntity customer = this.selectOne(new CustomerQuery().contactTelphone(mobileNumber));
if(customer==null){
throw new AppException("手机号码:" + mobileNumber + "没有注册用户");
}
String verifyCode = cacheService.get(SMS_VERIFY_CODE_KEY + mobileNumber);
if(StringUtils.isNotEmpty(verifyCode)){
throw new AppException("当前手机号码已发送验证码,请稍后重试");
}
try {
Map<String, String> params = new HashMap<>();
params.put("appid",appid);
params.put("phone",mobileNumber);
params.put("type",SMS_TPYE);
String[] json = new String[2];
String vCode = RandomUtil.randomNumbers(6);
json[0] = vCode;
json[1] = "1";
params.put("json",JSONObject.toJSON(json).toString());
String resp = HttpUtil.doPost(smsApiUrl,params);
JSONObject respJson = JSONObject.parseObject(resp);
if(respJson.getIntValue("code")==0){
throw new AppException("短信发送失败:" + respJson.getString("message"));
}
//有效期60秒
cacheService.setnx(SMS_VERIFY_CODE_KEY+mobileNumber,vCode,60);
}catch (Exception e){
log.error("短信发送异常",e);
throw new AppException("短信发送异常");
}
}
@Override
public CustomerEntity doSmsLogin(String mobileNumber, String verifyCode, String loginIp) throws AppException {
if(StringUtils.isEmpty(mobileNumber)){
throw new AppException("手机号不能为空");
}
if(StringUtils.isEmpty(verifyCode)){
throw new AppException("验证码不能为空");
}
if(!PhoneUtil.isPhone(mobileNumber)){
throw new AppException("手机号码格式不正确");
}
CustomerEntity customer = this.selectOne(new CustomerQuery().contactTelphone(mobileNumber));
if(customer==null){
throw new AppException("手机号码:" + mobileNumber + "没有注册用户");
}
String vCode = cacheService.get(SMS_VERIFY_CODE_KEY + mobileNumber);
if(StringUtils.isEmpty(vCode)){
throw new AppException("验证码已失效");
}
if(!verifyCode.equals(vCode)){
throw new AppException("验证码不正确");
}
CustomerEntity update = new CustomerEntity();
update.setId(customer.getId());
update.setLastLoginAddress(loginIp);
update.setLastLoginTime(new Date());
this.update(update);
return customer;
}
@Override
public CustomerEntity doWeChatLogin(String openId, String loginIp) throws AppException {
CustomerEntity customer = this.selectOne(new CustomerQuery().openId(openId));
if(customer==null){
throw new AppException("用户未绑定微信");
}
CustomerEntity update = new CustomerEntity();
update.setId(customer.getId());
update.setLastLoginAddress(loginIp);
update.setLastLoginTime(new Date());
this.update(update);
return customer;
}
public static void main(String[] args){
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("appid","ADsUXLrS81vZDU95");
jsonObject.put("phone","18981841597");
jsonObject.put("type",SMS_TPYE);
Map<String, String> params = new HashMap<>();
params.put("appid","ADsUXLrS81vZDU95");
params.put("phone","18981841597");
params.put("type",SMS_TPYE);
String vCode = RandomUtil.randomNumbers(6);
params.put("json","[\"123456\",\"1\"]");
List<String> jj = new ArrayList<>();
jj.add("1111");
jj.add("2");
System.out.println(JSONObject.toJSON(jj).toString());
String[] json = new String[2];
json[0] = vCode;
json[1] = "1";
System.out.println(JSONObject.toJSON(json).toString());
params.put("json",JSONObject.toJSON(jj).toString());
// String resp = HttpUtil.doPost("http://sms.wx3.com.cn/api/index/index",params);
// System.out.println(resp);
}catch (Exception e){
}
}
}
\ No newline at end of file
......@@ -54,6 +54,10 @@ public class CustomerWorkCollectServiceImpl extends AbstractCRUDServiceImpl<Cust
protected void saveBefore(CustomerWorkCollectEntity entity, Context context) throws AppException {
this.validData(entity, context);
entity.setCustomerId(this.getContextUserId(context));
DesignMasterplateEntity masterplateEntity = designMasterplateService.get(entity.getMasterplateId());
if(masterplateEntity!=null){
entity.setDesignType(masterplateEntity.getDesignType());
}
CustomerWorkCollectEntity query = new CustomerWorkCollectEntity();
query.setCustomerId(entity.getCustomerId());
query.setMasterplateId(entity.getMasterplateId());
......
......@@ -7,10 +7,7 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.WorkDesignStatusEnum;
import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.module.customer.dao.CustomerWorkDesignDao;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import com.mortals.xhx.module.customer.model.CustomerWorkDesignEntity;
import com.mortals.xhx.module.customer.model.CustomerWorkDesignStatEntity;
import com.mortals.xhx.module.customer.model.CustomerWorkDesignStatQuery;
import com.mortals.xhx.module.customer.model.*;
import com.mortals.xhx.module.customer.service.CustomerService;
import com.mortals.xhx.module.customer.service.CustomerWorkDesignService;
import com.mortals.xhx.module.customer.service.CustomerWorkDesignStatService;
......@@ -22,6 +19,8 @@ import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
......@@ -65,8 +64,13 @@ public class CustomerWorkDesignServiceImpl extends AbstractCRUDServiceImpl<Custo
if(CollectionUtils.isEmpty(cwdList)){
CustomerWorkDesignStatEntity cwdEntity = new CustomerWorkDesignStatEntity();
cwdEntity.setCustomerId(entity.getCustomerId());
cwdEntity.setCustomerDesignPictures(1);
cwdEntity.setCustomerDesignVideos(0);
if(entity.getDesignType()==1) {
cwdEntity.setCustomerDesignPictures(1);
cwdEntity.setCustomerDesignVideos(0);
}else {
cwdEntity.setCustomerDesignPictures(0);
cwdEntity.setCustomerDesignVideos(1);
}
cwdEntity.setCreateTime(new Date());
cwdEntity.setUpdateTime(new Date());
customerWorkDesignStatService.save(cwdEntity);
......@@ -74,7 +78,11 @@ public class CustomerWorkDesignServiceImpl extends AbstractCRUDServiceImpl<Custo
CustomerWorkDesignStatEntity cwdEntity = cwdList.get(0);
CustomerWorkDesignStatQuery updateEntity = new CustomerWorkDesignStatQuery();
updateEntity.setId(cwdEntity.getId());
updateEntity.setCustomerDesignPicturesIncrement(1);
if(entity.getDesignType()==1) {
updateEntity.setCustomerDesignPicturesIncrement(1);
}else {
updateEntity.setCustomerDesignVideosIncrement(1);
}
updateEntity.setUpdateTime(new Date());
customerWorkDesignStatService.update(updateEntity);
}
......@@ -135,6 +143,7 @@ public class CustomerWorkDesignServiceImpl extends AbstractCRUDServiceImpl<Custo
newMasterplate.setPreviewUrl(entity.getFrontCover());
newMasterplate.setDraft(workDesign.getDraft());
newMasterplate.setPlateType(entity.getPlateType()==null?1:entity.getPlateType());
newMasterplate.setDesignType(workDesign.getDesignType());
newMasterplate.setCreateTime(new Date());
designMasterplateService.save(newMasterplate,context);
return 1;
......@@ -152,7 +161,8 @@ public class CustomerWorkDesignServiceImpl extends AbstractCRUDServiceImpl<Custo
@Override
public int remove(Long[] ids, Context context) throws AppException {
this.removeBefore(ids, context);
List<CustomerWorkDesignEntity> list = this.get(ids,context);
List<Long> idList = new ArrayList<>(Arrays.asList(ids));
List<CustomerWorkDesignEntity> list = this.find(new CustomerWorkDesignQuery().idList(idList));
int iRet = this.dao.delete(ids);
if(CollectionUtils.isNotEmpty(list)){
list.forEach(e->{
......
package com.mortals.xhx.module.customer.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
......@@ -9,13 +10,17 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.CustomerSatusEnum;
import com.mortals.xhx.common.code.CustomerSrcEnum;
import com.mortals.xhx.common.code.MemberLevelEnum;
import com.mortals.xhx.common.code.SexEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.utils.LoginAESUtil;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import com.mortals.xhx.module.customer.model.CustomerEntityExt;
import com.mortals.xhx.module.customer.model.CustomerQuery;
import com.mortals.xhx.module.customer.service.CustomerService;
import org.springframework.web.bind.annotation.*;
......@@ -32,6 +37,9 @@ import java.util.*;
@RequestMapping("customer")
public class CustomerController extends BaseCRUDJsonBodyMappingController<CustomerService,CustomerEntity,Long> {
private static final String AES_KEY = "0000000671595991";
private static final String AES_IV = "tdrdadq59tbss5n7";
public CustomerController(){
super.setModuleDesc( "客户管理");
}
......@@ -45,6 +53,18 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
super.init(model, context);
}
@Override
protected void saveBefore(CustomerEntity entity, Map<String, Object> model, Context context) throws AppException {
if(StringUtils.isNotEmpty(entity.getPassword())) {
String oldPwd = LoginAESUtil.decrypt(entity.getPassword(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setPassword(oldPwd);
}
if(StringUtils.isNotEmpty(entity.getLoginName())) {
String loginName = LoginAESUtil.decrypt(entity.getLoginName(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginName(loginName);
}
}
@Override
protected void doListBefore(CustomerEntity query, Map<String, Object> model, Context context) throws AppException {
Map<String,String> orderCols = new HashMap<>();
......@@ -53,6 +73,7 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
}
@Override
@UnAuth
public Rest<Object> list(@RequestBody(required = false) CustomerEntity query) {
Map<String, Object> model = new HashMap();
Rest<Object> ret = new Rest();
......@@ -64,8 +85,14 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
PageInfo pageInfo = this.buildPageInfo(query);
this.doListBefore(query, model, context);
Result result = this.getService().findExt(query, pageInfo, context);
Map<String,Object> census = service.getCustomerCensus();
model.put("data", result.getList());
model.put("pageInfo", result.getPageInfo());
model.put("trial", census.get("trial"));
model.put("vip", census.get("vip"));
model.put("designer", census.get("designer"));
model.put("picturesCount", census.get("picturesCount"));
model.put("videosCount", census.get("videosCount"));
this.parsePageInfo(model, result.getPageInfo());
code = this.doListAfter(query, model, context);
this.recordSysLog(this.request, busiDesc + " 【成功】");
......@@ -202,6 +229,18 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
String busiDesc = "客户修改密码";
int code = 1;
try {
if(StringUtils.isNotEmpty(entity.getLoginName())) {
String loginName = LoginAESUtil.decrypt(entity.getLoginName(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginName(loginName);
}
if(StringUtils.isNotEmpty(entity.getOldPassword())) {
String oldPwd = LoginAESUtil.decrypt(entity.getOldPassword(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setOldPassword(oldPwd);
}
if(StringUtils.isNotEmpty(entity.getNewPassword())) {
String newPwd = LoginAESUtil.decrypt(entity.getNewPassword(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setNewPassword(newPwd);
}
entity.setUpdateTime(new Date());
entity.setId(user.getId());
entity.setUpdateUserId(user.getId());
......@@ -241,6 +280,14 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
String busiDesc = "客户修改密码";
int code = 1;
try {
if(StringUtils.isNotEmpty(entity.getOldPassword())) {
String oldPwd = LoginAESUtil.decrypt(entity.getOldPassword(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setOldPassword(oldPwd);
}
if(StringUtils.isNotEmpty(entity.getNewPassword())) {
String newPwd = LoginAESUtil.decrypt(entity.getNewPassword(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setNewPassword(newPwd);
}
entity.setUpdateTime(new Date());
entity.setId(user.getId());
entity.setUpdateUserId(user.getId());
......@@ -280,6 +327,10 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
String busiDesc = "管理员修改密码";
int code = 1;
try {
if(StringUtils.isNotEmpty(entity.getNewPassword())) {
String newPwd = LoginAESUtil.decrypt(entity.getNewPassword(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setNewPassword(newPwd);
}
this.service.changePasswordByAdmin(entity, context);
model.put("id", entity.getId());
model.put("entity", entity);
......@@ -300,4 +351,31 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
return ret.toJSONString();
}
@Override
@UnAuth
public void exportExcel(@RequestBody CustomerEntity query) {
Context context = this.getContext();
String busiDesc = "导出" + this.getModuleDesc();
ArrayList properties = new ArrayList();
try {
this.doExportBefore(context, query,properties);
String name = StringUtils.trim(this.moduleDesc);
if (StringUtils.isEmpty(name)) {
name = System.currentTimeMillis() + "";
}
String fileName = name + ".xlsx";
PageInfo pageInfo = new PageInfo(-1);
List<CustomerEntityExt> list = this.service.findExt(query, pageInfo, this.getContext()).getList();
Class<CustomerEntityExt> tClass = ReflectUtils.getClassGenricType(this.getClass(), 1);
ExcelUtil<CustomerEntityExt, Long> util = new ExcelUtil(tClass);
byte[] data = util.exportExcel(list, name);
this.responseStream(this.response, data, fileName);
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var11) {
this.doException(this.request, "导出异常", new HashMap(), var11);
}
}
}
\ No newline at end of file
package com.mortals.xhx.module.customer.web;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.DesignTypeEnum;
import com.mortals.xhx.common.key.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -43,6 +45,7 @@ public class CustomerWorkCollectController extends BaseCRUDJsonBodyMappingContro
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "designType", IBaseEnum.getEnumMap(DesignTypeEnum.class));
super.init(model, context);
}
......
......@@ -6,20 +6,24 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.DesignTypeEnum;
import com.mortals.xhx.common.code.WorkDesignStatusEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.module.customer.model.CustomerWorkDesignEntity;
import com.mortals.xhx.module.customer.service.CustomerWorkDesignService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
......@@ -39,6 +43,7 @@ public class CustomerWorkDesignController extends BaseCRUDJsonBodyMappingControl
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "workDesignStatus", IBaseEnum.getEnumMap(WorkDesignStatusEnum.class));
this.addDict(model, "designType", IBaseEnum.getEnumMap(DesignTypeEnum.class));
super.init(model, context);
}
......@@ -85,6 +90,7 @@ public class CustomerWorkDesignController extends BaseCRUDJsonBodyMappingControl
throw new AppException("非法用户,不可访问");
}
entity.setCustomerId(this.getCurUser().getId());
entity.setUpdateTime(entity.getCreateTime());
if(CollectionUtils.isNotEmpty(entity.getDesignContent())) {
entity.setDraft(JSONObject.toJSONString(entity.getDesignContent()));
}
......
package com.mortals.xhx.module.design.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.design.model.vo.DesignMasterplateVo;
import lombok.Data;
/**
* 模版管理实体对象
*
* @author zxfei
* @date 2022-07-26
* @date 2023-07-11
*/
@Data
public class DesignMasterplateEntity extends DesignMasterplateVo {
private static final long serialVersionUID = 1L;
......@@ -72,210 +72,10 @@ public class DesignMasterplateEntity extends DesignMasterplateVo {
* 版式。1:横版2竖版默认:1
*/
private Integer plateType;
public DesignMasterplateEntity(){}
/**
* 获取 模版名称
* @return String
*/
public String getMasterplateName(){
return masterplateName;
}
/**
* 设置 模版名称
* @param masterplateName
*/
public void setMasterplateName(String masterplateName){
this.masterplateName = masterplateName;
}
/**
* 获取 模版编码
* @return Integer
*/
public Integer getMasterplateCode(){
return masterplateCode;
}
/**
* 设置 模版编码
* @param masterplateCode
*/
public void setMasterplateCode(Integer masterplateCode){
this.masterplateCode = masterplateCode;
}
/**
* 获取 发布人
* @return Long
*/
public Long getCustomerId(){
return customerId;
}
/**
* 设置 发布人
* @param customerId
*/
public void setCustomerId(Long customerId){
this.customerId = customerId;
}
/**
* 获取 发布人名称
* @return String
*/
public String getCustomerName(){
return customerName;
}
/**
* 设置 发布人名称
* @param customerName
*/
public void setCustomerName(String customerName){
this.customerName = customerName;
}
/**
* 获取 模版描述
* @return String
*/
public String getMasterplateDesc(){
return masterplateDesc;
}
/**
* 设置 模版描述
* @param masterplateDesc
*/
public void setMasterplateDesc(String masterplateDesc){
this.masterplateDesc = masterplateDesc;
}
/**
* 获取 模版下载地址(相对地址)
* @return String
*/
public String getMasterplatePath(){
return masterplatePath;
}
/**
* 设置 模版下载地址(相对地址)
* @param masterplatePath
*/
public void setMasterplatePath(String masterplatePath){
this.masterplatePath = masterplatePath;
}
/**
* 获取 模版引用的图片
* @return String
*/
public String getPictureIds(){
return pictureIds;
}
/**
* 设置 模版引用的图片
* @param pictureIds
*/
public void setPictureIds(String pictureIds){
this.pictureIds = pictureIds;
}
/**
* 获取 模版引用的素材
* @return String
* 作品类型:1:图片,2:视频
*/
public String getPictureSrcIds(){
return pictureSrcIds;
}
/**
* 设置 模版引用的素材
* @param pictureSrcIds
*/
public void setPictureSrcIds(String pictureSrcIds){
this.pictureSrcIds = pictureSrcIds;
}
/**
* 获取 模版引用的背景
* @return String
*/
public String getPictureBackgroundIds(){
return pictureBackgroundIds;
}
/**
* 设置 模版引用的背景
* @param pictureBackgroundIds
*/
public void setPictureBackgroundIds(String pictureBackgroundIds){
this.pictureBackgroundIds = pictureBackgroundIds;
}
/**
* 获取 模版引用的字体
* @return String
*/
public String getFontIds(){
return fontIds;
}
/**
* 设置 模版引用的字体
* @param fontIds
*/
public void setFontIds(String fontIds){
this.fontIds = fontIds;
}
/**
* 获取 模版被引用的次数。默认:0
* @return Integer
*/
public Integer getMasterplateUseNum(){
return masterplateUseNum;
}
/**
* 设置 模版被引用的次数。默认:0
* @param masterplateUseNum
*/
public void setMasterplateUseNum(Integer masterplateUseNum){
this.masterplateUseNum = masterplateUseNum;
}
/**
* 获取 作品图片预览地址(相对地址)
* @return String
*/
public String getPreviewUrl(){
return previewUrl;
}
/**
* 设置 作品图片预览地址(相对地址)
* @param previewUrl
*/
public void setPreviewUrl(String previewUrl){
this.previewUrl = previewUrl;
}
/**
* 获取 设计草稿
* @return String
*/
public String getDraft(){
return draft;
}
/**
* 设置 设计草稿
* @param draft
*/
public void setDraft(String draft){
this.draft = draft;
}
/**
* 获取 版式。1:横版2竖版默认:1
* @return Integer
*/
public Integer getPlateType(){
return plateType;
}
/**
* 设置 版式。1:横版2竖版默认:1
* @param plateType
*/
public void setPlateType(Integer plateType){
this.plateType = plateType;
}
private Integer designType;
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -292,32 +92,13 @@ public class DesignMasterplateEntity extends DesignMasterplateVo {
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",masterplateName:").append(getMasterplateName());
sb.append(",masterplateCode:").append(getMasterplateCode());
sb.append(",customerId:").append(getCustomerId());
sb.append(",customerName:").append(getCustomerName());
sb.append(",masterplateDesc:").append(getMasterplateDesc());
sb.append(",masterplatePath:").append(getMasterplatePath());
sb.append(",pictureIds:").append(getPictureIds());
sb.append(",pictureSrcIds:").append(getPictureSrcIds());
sb.append(",pictureBackgroundIds:").append(getPictureBackgroundIds());
sb.append(",fontIds:").append(getFontIds());
sb.append(",masterplateUseNum:").append(getMasterplateUseNum());
sb.append(",previewUrl:").append(getPreviewUrl());
sb.append(",draft:").append(getDraft());
sb.append(",plateType:").append(getPlateType());
return sb.toString();
}
public void initAttrValue(){
this.masterplateName = "";
this.masterplateCode = null;
this.masterplateCode = -1;
this.customerId = null;
this.customerId = -1L;
this.customerName = "";
......@@ -333,12 +114,14 @@ public class DesignMasterplateEntity extends DesignMasterplateVo {
this.fontIds = "";
this.masterplateUseNum = null;
this.masterplateUseNum = -1;
this.previewUrl = "";
this.draft = "";
this.plateType = null;
this.plateType = -1;
this.designType = 1;
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ import com.mortals.xhx.module.design.model.DesignMasterplateEntity;
* 模版管理查询对象
*
* @author zxfei
* @date 2022-07-26
* @date 2023-07-11
*/
public class DesignMasterplateQuery extends DesignMasterplateEntity {
/** 开始 主键ID,主键,自增长 */
......@@ -21,9 +21,14 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/** 主键ID,主键,自增长排除列表 */
private List <Long> idNotList;
/** 模版名称 */
private List<String> masterplateNameList;
/** 模版名称排除列表 */
private List <String> masterplateNameNotList;
/** 开始 模版编码 */
private Integer masterplateCodeStart;
......@@ -36,6 +41,9 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
/** 模版编码列表 */
private List <Integer> masterplateCodeList;
/** 模版编码排除列表 */
private List <Integer> masterplateCodeNotList;
/** 开始 发布人 */
private Long customerIdStart;
......@@ -48,9 +56,14 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
/** 发布人列表 */
private List <Long> customerIdList;
/** 发布人排除列表 */
private List <Long> customerIdNotList;
/** 发布人名称 */
private List<String> customerNameList;
/** 发布人名称排除列表 */
private List <String> customerNameNotList;
/** 开始 发布时间 */
private String createTimeStart;
......@@ -60,21 +73,33 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
/** 模版描述 */
private List<String> masterplateDescList;
/** 模版描述排除列表 */
private List <String> masterplateDescNotList;
/** 模版下载地址(相对地址) */
private List<String> masterplatePathList;
/** 模版下载地址(相对地址)排除列表 */
private List <String> masterplatePathNotList;
/** 模版引用的图片 */
private List<String> pictureIdsList;
/** 模版引用的图片排除列表 */
private List <String> pictureIdsNotList;
/** 模版引用的素材 */
private List<String> pictureSrcIdsList;
/** 模版引用的素材排除列表 */
private List <String> pictureSrcIdsNotList;
/** 模版引用的背景 */
private List<String> pictureBackgroundIdsList;
/** 模版引用的背景排除列表 */
private List <String> pictureBackgroundIdsNotList;
/** 模版引用的字体 */
private List<String> fontIdsList;
/** 模版引用的字体排除列表 */
private List <String> fontIdsNotList;
/** 开始 模版被引用的次数。默认:0 */
private Integer masterplateUseNumStart;
......@@ -87,12 +112,19 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
/** 模版被引用的次数。默认:0列表 */
private List <Integer> masterplateUseNumList;
/** 模版被引用的次数。默认:0排除列表 */
private List <Integer> masterplateUseNumNotList;
/** 作品图片预览地址(相对地址) */
private List<String> previewUrlList;
/** 作品图片预览地址(相对地址)排除列表 */
private List <String> previewUrlNotList;
/** 设计草稿 */
private List<String> draftList;
/** 设计草稿排除列表 */
private List <String> draftNotList;
/** 开始 版式。1:横版2竖版默认:1 */
private Integer plateTypeStart;
......@@ -105,6 +137,24 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
/** 版式。1:横版2竖版默认:1列表 */
private List <Integer> plateTypeList;
/** 版式。1:横版2竖版默认:1排除列表 */
private List <Integer> plateTypeNotList;
/** 开始 作品类型:1:图片,2:视频 */
private Integer designTypeStart;
/** 结束 作品类型:1:图片,2:视频 */
private Integer designTypeEnd;
/** 增加 作品类型:1:图片,2:视频 */
private Integer designTypeIncrement;
/** 作品类型:1:图片,2:视频列表 */
private List <Integer> designTypeList;
/** 作品类型:1:图片,2:视频排除列表 */
private List <Integer> designTypeNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DesignMasterplateQuery> orConditionList;
......@@ -177,6 +227,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
this.idList = idList;
}
/**
* 获取 主键ID,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 模版名称
* @return masterplateNameList
......@@ -192,6 +259,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setMasterplateNameList(List<String> masterplateNameList){
this.masterplateNameList = masterplateNameList;
}
/**
* 获取 模版名称
* @return masterplateNameNotList
*/
public List<String> getMasterplateNameNotList(){
return this.masterplateNameNotList;
}
/**
* 设置 模版名称
* @param masterplateNameNotList
*/
public void setMasterplateNameNotList(List<String> masterplateNameNotList){
this.masterplateNameNotList = masterplateNameNotList;
}
/**
* 获取 开始 模版编码
* @return masterplateCodeStart
......@@ -256,6 +340,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
this.masterplateCodeList = masterplateCodeList;
}
/**
* 获取 模版编码
* @return masterplateCodeNotList
*/
public List<Integer> getMasterplateCodeNotList(){
return this.masterplateCodeNotList;
}
/**
* 设置 模版编码
* @param masterplateCodeNotList
*/
public void setMasterplateCodeNotList(List<Integer> masterplateCodeNotList){
this.masterplateCodeNotList = masterplateCodeNotList;
}
/**
* 获取 开始 发布人
* @return customerIdStart
......@@ -320,6 +421,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
this.customerIdList = customerIdList;
}
/**
* 获取 发布人
* @return customerIdNotList
*/
public List<Long> getCustomerIdNotList(){
return this.customerIdNotList;
}
/**
* 设置 发布人
* @param customerIdNotList
*/
public void setCustomerIdNotList(List<Long> customerIdNotList){
this.customerIdNotList = customerIdNotList;
}
/**
* 获取 发布人名称
* @return customerNameList
......@@ -335,6 +453,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setCustomerNameList(List<String> customerNameList){
this.customerNameList = customerNameList;
}
/**
* 获取 发布人名称
* @return customerNameNotList
*/
public List<String> getCustomerNameNotList(){
return this.customerNameNotList;
}
/**
* 设置 发布人名称
* @param customerNameNotList
*/
public void setCustomerNameNotList(List<String> customerNameNotList){
this.customerNameNotList = customerNameNotList;
}
/**
* 获取 开始 发布时间
* @return createTimeStart
......@@ -382,6 +517,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setMasterplateDescList(List<String> masterplateDescList){
this.masterplateDescList = masterplateDescList;
}
/**
* 获取 模版描述
* @return masterplateDescNotList
*/
public List<String> getMasterplateDescNotList(){
return this.masterplateDescNotList;
}
/**
* 设置 模版描述
* @param masterplateDescNotList
*/
public void setMasterplateDescNotList(List<String> masterplateDescNotList){
this.masterplateDescNotList = masterplateDescNotList;
}
/**
* 获取 模版下载地址(相对地址)
* @return masterplatePathList
......@@ -397,6 +549,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setMasterplatePathList(List<String> masterplatePathList){
this.masterplatePathList = masterplatePathList;
}
/**
* 获取 模版下载地址(相对地址)
* @return masterplatePathNotList
*/
public List<String> getMasterplatePathNotList(){
return this.masterplatePathNotList;
}
/**
* 设置 模版下载地址(相对地址)
* @param masterplatePathNotList
*/
public void setMasterplatePathNotList(List<String> masterplatePathNotList){
this.masterplatePathNotList = masterplatePathNotList;
}
/**
* 获取 模版引用的图片
* @return pictureIdsList
......@@ -412,6 +581,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setPictureIdsList(List<String> pictureIdsList){
this.pictureIdsList = pictureIdsList;
}
/**
* 获取 模版引用的图片
* @return pictureIdsNotList
*/
public List<String> getPictureIdsNotList(){
return this.pictureIdsNotList;
}
/**
* 设置 模版引用的图片
* @param pictureIdsNotList
*/
public void setPictureIdsNotList(List<String> pictureIdsNotList){
this.pictureIdsNotList = pictureIdsNotList;
}
/**
* 获取 模版引用的素材
* @return pictureSrcIdsList
......@@ -427,6 +613,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setPictureSrcIdsList(List<String> pictureSrcIdsList){
this.pictureSrcIdsList = pictureSrcIdsList;
}
/**
* 获取 模版引用的素材
* @return pictureSrcIdsNotList
*/
public List<String> getPictureSrcIdsNotList(){
return this.pictureSrcIdsNotList;
}
/**
* 设置 模版引用的素材
* @param pictureSrcIdsNotList
*/
public void setPictureSrcIdsNotList(List<String> pictureSrcIdsNotList){
this.pictureSrcIdsNotList = pictureSrcIdsNotList;
}
/**
* 获取 模版引用的背景
* @return pictureBackgroundIdsList
......@@ -442,6 +645,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setPictureBackgroundIdsList(List<String> pictureBackgroundIdsList){
this.pictureBackgroundIdsList = pictureBackgroundIdsList;
}
/**
* 获取 模版引用的背景
* @return pictureBackgroundIdsNotList
*/
public List<String> getPictureBackgroundIdsNotList(){
return this.pictureBackgroundIdsNotList;
}
/**
* 设置 模版引用的背景
* @param pictureBackgroundIdsNotList
*/
public void setPictureBackgroundIdsNotList(List<String> pictureBackgroundIdsNotList){
this.pictureBackgroundIdsNotList = pictureBackgroundIdsNotList;
}
/**
* 获取 模版引用的字体
* @return fontIdsList
......@@ -457,6 +677,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setFontIdsList(List<String> fontIdsList){
this.fontIdsList = fontIdsList;
}
/**
* 获取 模版引用的字体
* @return fontIdsNotList
*/
public List<String> getFontIdsNotList(){
return this.fontIdsNotList;
}
/**
* 设置 模版引用的字体
* @param fontIdsNotList
*/
public void setFontIdsNotList(List<String> fontIdsNotList){
this.fontIdsNotList = fontIdsNotList;
}
/**
* 获取 开始 模版被引用的次数。默认:0
* @return masterplateUseNumStart
......@@ -521,6 +758,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
this.masterplateUseNumList = masterplateUseNumList;
}
/**
* 获取 模版被引用的次数。默认:0
* @return masterplateUseNumNotList
*/
public List<Integer> getMasterplateUseNumNotList(){
return this.masterplateUseNumNotList;
}
/**
* 设置 模版被引用的次数。默认:0
* @param masterplateUseNumNotList
*/
public void setMasterplateUseNumNotList(List<Integer> masterplateUseNumNotList){
this.masterplateUseNumNotList = masterplateUseNumNotList;
}
/**
* 获取 作品图片预览地址(相对地址)
* @return previewUrlList
......@@ -536,6 +790,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setPreviewUrlList(List<String> previewUrlList){
this.previewUrlList = previewUrlList;
}
/**
* 获取 作品图片预览地址(相对地址)
* @return previewUrlNotList
*/
public List<String> getPreviewUrlNotList(){
return this.previewUrlNotList;
}
/**
* 设置 作品图片预览地址(相对地址)
* @param previewUrlNotList
*/
public void setPreviewUrlNotList(List<String> previewUrlNotList){
this.previewUrlNotList = previewUrlNotList;
}
/**
* 获取 设计草稿
* @return draftList
......@@ -551,6 +822,23 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setDraftList(List<String> draftList){
this.draftList = draftList;
}
/**
* 获取 设计草稿
* @return draftNotList
*/
public List<String> getDraftNotList(){
return this.draftNotList;
}
/**
* 设置 设计草稿
* @param draftNotList
*/
public void setDraftNotList(List<String> draftNotList){
this.draftNotList = draftNotList;
}
/**
* 获取 开始 版式。1:横版2竖版默认:1
* @return plateTypeStart
......@@ -615,6 +903,104 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
this.plateTypeList = plateTypeList;
}
/**
* 获取 版式。1:横版2竖版默认:1
* @return plateTypeNotList
*/
public List<Integer> getPlateTypeNotList(){
return this.plateTypeNotList;
}
/**
* 设置 版式。1:横版2竖版默认:1
* @param plateTypeNotList
*/
public void setPlateTypeNotList(List<Integer> plateTypeNotList){
this.plateTypeNotList = plateTypeNotList;
}
/**
* 获取 开始 作品类型:1:图片,2:视频
* @return designTypeStart
*/
public Integer getDesignTypeStart(){
return this.designTypeStart;
}
/**
* 设置 开始 作品类型:1:图片,2:视频
* @param designTypeStart
*/
public void setDesignTypeStart(Integer designTypeStart){
this.designTypeStart = designTypeStart;
}
/**
* 获取 结束 作品类型:1:图片,2:视频
* @return $designTypeEnd
*/
public Integer getDesignTypeEnd(){
return this.designTypeEnd;
}
/**
* 设置 结束 作品类型:1:图片,2:视频
* @param designTypeEnd
*/
public void setDesignTypeEnd(Integer designTypeEnd){
this.designTypeEnd = designTypeEnd;
}
/**
* 获取 增加 作品类型:1:图片,2:视频
* @return designTypeIncrement
*/
public Integer getDesignTypeIncrement(){
return this.designTypeIncrement;
}
/**
* 设置 增加 作品类型:1:图片,2:视频
* @param designTypeIncrement
*/
public void setDesignTypeIncrement(Integer designTypeIncrement){
this.designTypeIncrement = designTypeIncrement;
}
/**
* 获取 作品类型:1:图片,2:视频
* @return designTypeList
*/
public List<Integer> getDesignTypeList(){
return this.designTypeList;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeList
*/
public void setDesignTypeList(List<Integer> designTypeList){
this.designTypeList = designTypeList;
}
/**
* 获取 作品类型:1:图片,2:视频
* @return designTypeNotList
*/
public List<Integer> getDesignTypeNotList(){
return this.designTypeNotList;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeNotList
*/
public void setDesignTypeNotList(List<Integer> designTypeNotList){
this.designTypeNotList = designTypeNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
......@@ -660,6 +1046,15 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
return this;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public DesignMasterplateQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 模版名称
......@@ -724,6 +1119,15 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
return this;
}
/**
* 设置 模版编码
* @param masterplateCodeNotList
*/
public DesignMasterplateQuery masterplateCodeNotList(List<Integer> masterplateCodeNotList){
this.masterplateCodeNotList = masterplateCodeNotList;
return this;
}
/**
* 设置 发布人
* @param customerId
......@@ -769,6 +1173,15 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
return this;
}
/**
* 设置 发布人
* @param customerIdNotList
*/
public DesignMasterplateQuery customerIdNotList(List<Long> customerIdNotList){
this.customerIdNotList = customerIdNotList;
return this;
}
/**
* 设置 发布人名称
......@@ -948,6 +1361,15 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
return this;
}
/**
* 设置 模版被引用的次数。默认:0
* @param masterplateUseNumNotList
*/
public DesignMasterplateQuery masterplateUseNumNotList(List<Integer> masterplateUseNumNotList){
this.masterplateUseNumNotList = masterplateUseNumNotList;
return this;
}
/**
* 设置 作品图片预览地址(相对地址)
......@@ -1031,6 +1453,69 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
return this;
}
/**
* 设置 版式。1:横版2竖版默认:1
* @param plateTypeNotList
*/
public DesignMasterplateQuery plateTypeNotList(List<Integer> plateTypeNotList){
this.plateTypeNotList = plateTypeNotList;
return this;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designType
*/
public DesignMasterplateQuery designType(Integer designType){
setDesignType(designType);
return this;
}
/**
* 设置 开始 作品类型:1:图片,2:视频
* @param designTypeStart
*/
public DesignMasterplateQuery designTypeStart(Integer designTypeStart){
this.designTypeStart = designTypeStart;
return this;
}
/**
* 设置 结束 作品类型:1:图片,2:视频
* @param designTypeEnd
*/
public DesignMasterplateQuery designTypeEnd(Integer designTypeEnd){
this.designTypeEnd = designTypeEnd;
return this;
}
/**
* 设置 增加 作品类型:1:图片,2:视频
* @param designTypeIncrement
*/
public DesignMasterplateQuery designTypeIncrement(Integer designTypeIncrement){
this.designTypeIncrement = designTypeIncrement;
return this;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeList
*/
public DesignMasterplateQuery designTypeList(List<Integer> designTypeList){
this.designTypeList = designTypeList;
return this;
}
/**
* 设置 作品类型:1:图片,2:视频
* @param designTypeNotList
*/
public DesignMasterplateQuery designTypeNotList(List<Integer> designTypeNotList){
this.designTypeNotList = designTypeNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
package com.mortals.xhx.module.design.web;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.DesignTypeEnum;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -45,6 +47,7 @@ public class DesignMasterplateController extends BaseCRUDJsonBodyMappingControll
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "designType", IBaseEnum.getEnumMap(DesignTypeEnum.class));
super.init(model, context);
}
......
......@@ -52,8 +52,13 @@ public class PictureGroupController extends BaseCRUDJsonBodyMappingController<Pa
if(paramEntities.isEmpty()){
max = 1;
}else {
ParamEntity maxEntity = paramEntities.stream().max(Comparator.comparing(ParamEntity::getParamKey)).get();
max = DataUtil.converStr2Int(maxEntity.getParamKey(),paramEntities.size())+1;
for(ParamEntity item:paramEntities){
int temp = DataUtil.converStr2Int(item.getParamKey(),0);
if(max < temp){
max = temp;
}
}
max++;
}
entity.setParamKey(max+"");
entity.setName("素材分组");
......
package com.mortals.xhx.module.question.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
......@@ -55,6 +56,7 @@ public class QuestionRecordController extends BaseCRUDJsonBodyMappingController<
}
@PostMapping({"ask"})
@UnAuth
public String ask(@RequestBody QuestionRecordEntity entity) {
Map<String, Object> model = new HashMap();
......@@ -62,14 +64,19 @@ public class QuestionRecordController extends BaseCRUDJsonBodyMappingController<
String busiDesc = "新增咨询" + this.getModuleDesc();
int code = 1;
try {
if(this.getCurUser()==null||this.getCurUser().getUserType()!= Constant.CUSTOMER_USER){
throw new AppException("非法用户,不可访问");
if(this.getCurUser()==null){
entity.setCustomerId(-1l);
entity.setCustName("游客");
entity.setContactTelphone("12345678901");
entity.setOrganization("游客");
}else {
CustomerEntity customerEntity = customerService.get(this.getCurUser().getId());
entity.setCustomerId(this.getCurUser().getId());
entity.setCustName(customerEntity.getCustName());
entity.setContactTelphone(customerEntity.getContactTelphone());
entity.setOrganization(customerEntity.getOrganization());
}
CustomerEntity customerEntity = customerService.get(this.getCurUser().getId());
entity.setCustomerId(this.getCurUser().getId());
entity.setCustName(customerEntity.getCustName());
entity.setContactTelphone(customerEntity.getContactTelphone());
entity.setOrganization(customerEntity.getOrganization());
entity = this.service.ask(entity,context);
model.put("entity", entity);
......
......@@ -18,12 +18,6 @@ spring:
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
rabbitmq:
host: @profiles.rabbitmq.host@
port: @profiles.rabbitmq.port@
username: @profiles.rabbitmq.username@
password: @profiles.rabbitmq.password@
virtualHost: @profiles.rabbitmq.virtualhost@
security:
enable: true
user:
......
......@@ -28,6 +28,11 @@
<result property="lastLoginAddress" column="lastLoginAddress" />
<result property="lastModPwdTime" column="lastModPwdTime" />
<result property="lastModPwdAddr" column="lastModPwdAddr" />
<result property="saltKey" column="saltKey" />
<result property="lastUpdatePwdTime" column="lastUpdatePwdTime" />
<result property="errorCount" column="errorCount" />
<result property="loginLock" column="loginLock" />
<result property="lockTime" column="lockTime" />
</resultMap>
<!-- 表所有列 -->
......@@ -102,23 +107,38 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastModPwdAddr') or colPickMode == 1 and data.containsKey('lastModPwdAddr')))">
a.lastModPwdAddr as lastModPwdAddr,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('saltKey') or colPickMode == 1 and data.containsKey('saltKey')))">
a.saltKey,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastUpdatePwdTime') or colPickMode == 1 and data.containsKey('lastUpdatePwdTime')))">
a.lastUpdatePwdTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('errorCount') or colPickMode == 1 and data.containsKey('errorCount')))">
a.errorCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('loginLock') or colPickMode == 1 and data.containsKey('loginLock')))">
a.loginLock,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lockTime') or colPickMode == 1 and data.containsKey('lockTime')))">
a.lockTime,
</if>
</trim>
</sql>
<!-- 新增 -->
<insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_user
(loginName,loginPwd,loginPwd1,loginPwd2,loginPwd3,loginLimitAddress,realName,mobile,phone,email,qq,userType,siteId,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,lastModPwdTime,lastModPwdAddr)
(loginName,loginPwd,loginPwd1,loginPwd2,loginPwd3,loginLimitAddress,realName,mobile,phone,email,qq,userType,siteId,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,lastModPwdTime,lastModPwdAddr,saltKey,lastUpdatePwdTime,errorCount,loginLock,lockTime)
VALUES
(#{loginName},#{loginPwd},#{loginPwd1},#{loginPwd2},#{loginPwd3},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{siteId},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress},#{lastModPwdTime},#{lastModPwdAddr})
(#{loginName},#{loginPwd},#{loginPwd1},#{loginPwd2},#{loginPwd3},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{siteId},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress},#{lastModPwdTime},#{lastModPwdAddr},#{saltKey},#{lastUpdatePwdTime},#{errorCount},#{loginLock},#{lockTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_user
(loginName,loginPwd,loginPwd1,loginPwd2,loginPwd3,loginLimitAddress,realName,mobile,phone,email,qq,userType,siteId,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,lastModPwdTime,lastModPwdAddr)
(loginName,loginPwd,loginPwd1,loginPwd2,loginPwd3,loginLimitAddress,realName,mobile,phone,email,qq,userType,siteId,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,lastModPwdTime,lastModPwdAddr,saltKey,lastUpdatePwdTime,errorCount,loginLock,lockTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.loginName},#{item.loginPwd},#{item.loginPwd1},#{item.loginPwd2},#{item.loginPwd3},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.siteId},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.lastModPwdTime},#{item.lastModPwdAddr})
(#{item.loginName},#{item.loginPwd},#{item.loginPwd1},#{item.loginPwd2},#{item.loginPwd3},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.siteId},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.lastModPwdTime},#{item.lastModPwdAddr},#{item.saltKey},#{item.lastUpdatePwdTime},#{item.errorCount},#{item.loginLock},#{item.lockTime})
</foreach>
</insert>
<!-- 根据ParamDto更新 -->
......@@ -207,6 +227,27 @@
<if test="(colPickMode==0 and data.containsKey('lastModPwdAddr')) or (colPickMode==1 and !data.containsKey('lastModPwdAddr'))">
a.lastModPwdAddr=#{data.lastModPwdAddr},
</if>
<if test="(colPickMode==0 and data.containsKey('saltKey')) or (colPickMode==1 and !data.containsKey('saltKey'))">
a.saltKey=#{data.saltKey},
</if>
<if test="(colPickMode==0 and data.containsKey('lastUpdatePwdTime')) or (colPickMode==1 and !data.containsKey('lastUpdatePwdTime'))">
a.lastUpdatePwdTime=#{data.lastUpdatePwdTime},
</if>
<if test="(colPickMode==0 and data.containsKey('errorCount')) or (colPickMode==1 and !data.containsKey('errorCount'))">
a.errorCount=#{data.errorCount},
</if>
<if test="(colPickMode==0 and data.containsKey('errorCountIncrement')) or (colPickMode==1 and !data.containsKey('errorCountIncrement'))">
a.errorCount=ifnull(a.errorCount,0) + #{data.errorCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('loginLock')) or (colPickMode==1 and !data.containsKey('loginLock'))">
a.loginLock=#{data.loginLock},
</if>
<if test="(colPickMode==0 and data.containsKey('loginLockIncrement')) or (colPickMode==1 and !data.containsKey('loginLockIncrement'))">
a.loginLock=ifnull(a.loginLock,0) + #{data.loginLockIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('lockTime')) or (colPickMode==1 and !data.containsKey('lockTime'))">
a.lockTime=#{data.lockTime},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -421,6 +462,51 @@
</if>
</foreach>
</trim>
<trim prefix="saltKey=(case" suffix="ELSE saltKey end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('saltKey')) or (colPickMode==1 and !item.containsKey('saltKey'))">
when a.id=#{item.id} then #{item.saltKey}
</if>
</foreach>
</trim>
<trim prefix="lastUpdatePwdTime=(case" suffix="ELSE lastUpdatePwdTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('lastUpdatePwdTime')) or (colPickMode==1 and !item.containsKey('lastUpdatePwdTime'))">
when a.id=#{item.id} then #{item.lastUpdatePwdTime}
</if>
</foreach>
</trim>
<trim prefix="errorCount=(case" suffix="ELSE errorCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('errorCount')) or (colPickMode==1 and !item.containsKey('errorCount'))">
when a.id=#{item.id} then #{item.errorCount}
</when>
<when test="(colPickMode==0 and item.containsKey('errorCountIncrement')) or (colPickMode==1 and !item.containsKey('errorCountIncrement'))">
when a.id=#{item.id} then ifnull(a.errorCount,0) + #{item.errorCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="loginLock=(case" suffix="ELSE loginLock end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('loginLock')) or (colPickMode==1 and !item.containsKey('loginLock'))">
when a.id=#{item.id} then #{item.loginLock}
</when>
<when test="(colPickMode==0 and item.containsKey('loginLockIncrement')) or (colPickMode==1 and !item.containsKey('loginLockIncrement'))">
when a.id=#{item.id} then ifnull(a.loginLock,0) + #{item.loginLockIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="lockTime=(case" suffix="ELSE lockTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('lockTime')) or (colPickMode==1 and !item.containsKey('lockTime'))">
when a.id=#{item.id} then #{item.lockTime}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -901,6 +987,110 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('saltKey')">
<if test="conditionParamRef.saltKey != null and conditionParamRef.saltKey != ''">
${_conditionType_} a.saltKey like #{${_conditionParam_}.saltKey}
</if>
<if test="conditionParamRef.saltKey == null">
${_conditionType_} a.saltKey is null
</if>
</if>
<if test="conditionParamRef.containsKey('saltKeyList')">
${_conditionType_} a.saltKey in
<foreach collection="conditionParamRef.saltKeyList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('saltKeyNotList')">
${_conditionType_} a.saltKey not in
<foreach collection="conditionParamRef.saltKeyNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('lastUpdatePwdTime')">
<if test="conditionParamRef.lastUpdatePwdTime != null ">
${_conditionType_} a.lastUpdatePwdTime = #{${_conditionParam_}.lastUpdatePwdTime}
</if>
<if test="conditionParamRef.lastUpdatePwdTime == null">
${_conditionType_} a.lastUpdatePwdTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('lastUpdatePwdTimeStart') and conditionParamRef.lastUpdatePwdTimeStart != null and conditionParamRef.lastUpdatePwdTimeStart!=''">
${_conditionType_} a.lastUpdatePwdTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.lastUpdatePwdTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('lastUpdatePwdTimeEnd') and conditionParamRef.lastUpdatePwdTimeEnd != null and conditionParamRef.lastUpdatePwdTimeEnd!=''">
${_conditionType_} a.lastUpdatePwdTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.lastUpdatePwdTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('errorCount')">
<if test="conditionParamRef.errorCount != null ">
${_conditionType_} a.errorCount = #{${_conditionParam_}.errorCount}
</if>
<if test="conditionParamRef.errorCount == null">
${_conditionType_} a.errorCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('errorCountList')">
${_conditionType_} a.errorCount in
<foreach collection="conditionParamRef.errorCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('errorCountNotList')">
${_conditionType_} a.errorCount not in
<foreach collection="conditionParamRef.errorCountNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('errorCountStart') and conditionParamRef.errorCountStart != null">
${_conditionType_} a.errorCount <![CDATA[ >= ]]> #{${_conditionParam_}.errorCountStart}
</if>
<if test="conditionParamRef.containsKey('errorCountEnd') and conditionParamRef.errorCountEnd != null">
${_conditionType_} a.errorCount <![CDATA[ <= ]]> #{${_conditionParam_}.errorCountEnd}
</if>
<if test="conditionParamRef.containsKey('loginLock')">
<if test="conditionParamRef.loginLock != null ">
${_conditionType_} a.loginLock = #{${_conditionParam_}.loginLock}
</if>
<if test="conditionParamRef.loginLock == null">
${_conditionType_} a.loginLock is null
</if>
</if>
<if test="conditionParamRef.containsKey('loginLockList')">
${_conditionType_} a.loginLock in
<foreach collection="conditionParamRef.loginLockList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('loginLockNotList')">
${_conditionType_} a.loginLock not in
<foreach collection="conditionParamRef.loginLockNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('loginLockStart') and conditionParamRef.loginLockStart != null">
${_conditionType_} a.loginLock <![CDATA[ >= ]]> #{${_conditionParam_}.loginLockStart}
</if>
<if test="conditionParamRef.containsKey('loginLockEnd') and conditionParamRef.loginLockEnd != null">
${_conditionType_} a.loginLock <![CDATA[ <= ]]> #{${_conditionParam_}.loginLockEnd}
</if>
<if test="conditionParamRef.containsKey('lockTime')">
<if test="conditionParamRef.lockTime != null ">
${_conditionType_} a.lockTime = #{${_conditionParam_}.lockTime}
</if>
<if test="conditionParamRef.lockTime == null">
${_conditionType_} a.lockTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('lockTimeStart') and conditionParamRef.lockTimeStart != null and conditionParamRef.lockTimeStart!=''">
${_conditionType_} a.lockTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.lockTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('lockTimeEnd') and conditionParamRef.lockTimeEnd != null and conditionParamRef.lockTimeEnd!=''">
${_conditionType_} a.lockTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.lockTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -1029,6 +1219,31 @@
<if test='orderCol.lastModPwdAddr != null and "DESC".equalsIgnoreCase(orderCol.lastModPwdAddr)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('saltKey')">
a.saltKey
<if test='orderCol.saltKey != null and "DESC".equalsIgnoreCase(orderCol.saltKey)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('lastUpdatePwdTime')">
a.lastUpdatePwdTime
<if test='orderCol.lastUpdatePwdTime != null and "DESC".equalsIgnoreCase(orderCol.lastUpdatePwdTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('errorCount')">
a.errorCount
<if test='orderCol.errorCount != null and "DESC".equalsIgnoreCase(orderCol.errorCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('loginLock')">
a.loginLock
<if test='orderCol.loginLock != null and "DESC".equalsIgnoreCase(orderCol.loginLock)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('lockTime')">
a.lockTime
<if test='orderCol.lockTime != null and "DESC".equalsIgnoreCase(orderCol.lockTime)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
......@@ -25,6 +25,12 @@
<result property="updateTime" column="updateTime" />
<result property="lastLoginTime" column="lastLoginTime" />
<result property="lastLoginAddress" column="lastLoginAddress" />
<result property="openId" column="openId" />
<result property="saltKey" column="saltKey" />
<result property="lastUpdatePwdTime" column="lastUpdatePwdTime" />
<result property="errorCount" column="errorCount" />
<result property="loginLock" column="loginLock" />
<result property="lockTime" column="lockTime" />
</resultMap>
......@@ -92,23 +98,41 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))">
a.lastLoginAddress,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('openId') or colPickMode == 1 and data.containsKey('openId')))">
a.openId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('saltKey') or colPickMode == 1 and data.containsKey('saltKey')))">
a.saltKey,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastUpdatePwdTime') or colPickMode == 1 and data.containsKey('lastUpdatePwdTime')))">
a.lastUpdatePwdTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('errorCount') or colPickMode == 1 and data.containsKey('errorCount')))">
a.errorCount,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('loginLock') or colPickMode == 1 and data.containsKey('loginLock')))">
a.loginLock,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lockTime') or colPickMode == 1 and data.containsKey('lockTime')))">
a.lockTime,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="CustomerEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_customer
(loginName,password,memberLevel,custName,organization,contactTelphone,enterpriseConsultant,siteId,sex,mailbox,job,avatar,customerSrc,status,createUserId,createTime,updateTime,lastLoginTime,lastLoginAddress)
(loginName,password,memberLevel,custName,organization,contactTelphone,enterpriseConsultant,siteId,sex,mailbox,job,avatar,customerSrc,status,createUserId,createTime,updateTime,lastLoginTime,lastLoginAddress,openId,saltKey,lastUpdatePwdTime,errorCount,loginLock,lockTime)
VALUES
(#{loginName},#{password},#{memberLevel},#{custName},#{organization},#{contactTelphone},#{enterpriseConsultant},#{siteId},#{sex},#{mailbox},#{job},#{avatar},#{customerSrc},#{status},#{createUserId},#{createTime},#{updateTime},#{lastLoginTime},#{lastLoginAddress})
(#{loginName},#{password},#{memberLevel},#{custName},#{organization},#{contactTelphone},#{enterpriseConsultant},#{siteId},#{sex},#{mailbox},#{job},#{avatar},#{customerSrc},#{status},#{createUserId},#{createTime},#{updateTime},#{lastLoginTime},#{lastLoginAddress},#{openId},#{saltKey},#{lastUpdatePwdTime},#{errorCount},#{loginLock},#{lockTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_customer
(loginName,password,memberLevel,custName,organization,contactTelphone,enterpriseConsultant,siteId,sex,mailbox,job,avatar,customerSrc,status,createUserId,createTime,updateTime,lastLoginTime,lastLoginAddress)
(loginName,password,memberLevel,custName,organization,contactTelphone,enterpriseConsultant,siteId,sex,mailbox,job,avatar,customerSrc,status,createUserId,createTime,updateTime,lastLoginTime,lastLoginAddress,openId,saltKey,lastUpdatePwdTime,errorCount,loginLock,lockTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.loginName},#{item.password},#{item.memberLevel},#{item.custName},#{item.organization},#{item.contactTelphone},#{item.enterpriseConsultant},#{item.siteId},#{item.sex},#{item.mailbox},#{item.job},#{item.avatar},#{item.customerSrc},#{item.status},#{item.createUserId},#{item.createTime},#{item.updateTime},#{item.lastLoginTime},#{item.lastLoginAddress})
(#{item.loginName},#{item.password},#{item.memberLevel},#{item.custName},#{item.organization},#{item.contactTelphone},#{item.enterpriseConsultant},#{item.siteId},#{item.sex},#{item.mailbox},#{item.job},#{item.avatar},#{item.customerSrc},#{item.status},#{item.createUserId},#{item.createTime},#{item.updateTime},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.openId},#{item.saltKey},#{item.lastUpdatePwdTime},#{item.errorCount},#{item.loginLock},#{item.lockTime})
</foreach>
</insert>
......@@ -193,6 +217,30 @@
<if test="(colPickMode==0 and data.containsKey('lastLoginAddress')) or (colPickMode==1 and !data.containsKey('lastLoginAddress'))">
a.lastLoginAddress=#{data.lastLoginAddress},
</if>
<if test="(colPickMode==0 and data.containsKey('openId')) or (colPickMode==1 and !data.containsKey('openId'))">
a.openId=#{data.openId},
</if>
<if test="(colPickMode==0 and data.containsKey('saltKey')) or (colPickMode==1 and !data.containsKey('saltKey'))">
a.saltKey=#{data.saltKey},
</if>
<if test="(colPickMode==0 and data.containsKey('lastUpdatePwdTime')) or (colPickMode==1 and !data.containsKey('lastUpdatePwdTime'))">
a.lastUpdatePwdTime=#{data.lastUpdatePwdTime},
</if>
<if test="(colPickMode==0 and data.containsKey('errorCount')) or (colPickMode==1 and !data.containsKey('errorCount'))">
a.errorCount=#{data.errorCount},
</if>
<if test="(colPickMode==0 and data.containsKey('errorCountIncrement')) or (colPickMode==1 and !data.containsKey('errorCountIncrement'))">
a.errorCount=ifnull(a.errorCount,0) + #{data.errorCountIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('loginLock')) or (colPickMode==1 and !data.containsKey('loginLock'))">
a.loginLock=#{data.loginLock},
</if>
<if test="(colPickMode==0 and data.containsKey('loginLockIncrement')) or (colPickMode==1 and !data.containsKey('loginLockIncrement'))">
a.loginLock=ifnull(a.loginLock,0) + #{data.loginLockIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('lockTime')) or (colPickMode==1 and !data.containsKey('lockTime'))">
a.lockTime=#{data.lockTime},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -368,6 +416,58 @@
</if>
</foreach>
</trim>
<trim prefix="openId=(case" suffix="ELSE openId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('openId')) or (colPickMode==1 and !item.containsKey('openId'))">
when a.id=#{item.id} then #{item.openId}
</if>
</foreach>
</trim>
<trim prefix="saltKey=(case" suffix="ELSE saltKey end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('saltKey')) or (colPickMode==1 and !item.containsKey('saltKey'))">
when a.id=#{item.id} then #{item.saltKey}
</if>
</foreach>
</trim>
<trim prefix="lastUpdatePwdTime=(case" suffix="ELSE lastUpdatePwdTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('lastUpdatePwdTime')) or (colPickMode==1 and !item.containsKey('lastUpdatePwdTime'))">
when a.id=#{item.id} then #{item.lastUpdatePwdTime}
</if>
</foreach>
</trim>
<trim prefix="errorCount=(case" suffix="ELSE errorCount end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('errorCount')) or (colPickMode==1 and !item.containsKey('errorCount'))">
when a.id=#{item.id} then #{item.errorCount}
</when>
<when test="(colPickMode==0 and item.containsKey('errorCountIncrement')) or (colPickMode==1 and !item.containsKey('errorCountIncrement'))">
when a.id=#{item.id} then ifnull(a.errorCount,0) + #{item.errorCountIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="loginLock=(case" suffix="ELSE loginLock end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('loginLock')) or (colPickMode==1 and !item.containsKey('loginLock'))">
when a.id=#{item.id} then #{item.loginLock}
</when>
<when test="(colPickMode==0 and item.containsKey('loginLockIncrement')) or (colPickMode==1 and !item.containsKey('loginLockIncrement'))">
when a.id=#{item.id} then ifnull(a.loginLock,0) + #{item.loginLockIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="lockTime=(case" suffix="ELSE lockTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('lockTime')) or (colPickMode==1 and !item.containsKey('lockTime'))">
when a.id=#{item.id} then #{item.lockTime}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -391,6 +491,21 @@
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_xhx_customer where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_xhx_customer where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_customer as a
......@@ -477,12 +592,18 @@
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList')">
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
${_conditionType_} a.id not in
<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
......@@ -499,12 +620,18 @@
${_conditionType_} a.loginName is null
</if>
</if>
<if test="conditionParamRef.containsKey('loginNameList')">
<if test="conditionParamRef.containsKey('loginNameList') and conditionParamRef.loginNameList.size() > 0">
${_conditionType_} a.loginName in
<foreach collection="conditionParamRef.loginNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('loginNameNotList') and conditionParamRef.loginNameNotList.size() > 0">
${_conditionType_} a.loginName not in
<foreach collection="conditionParamRef.loginNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('password')">
<if test="conditionParamRef.password != null and conditionParamRef.password != ''">
......@@ -514,12 +641,18 @@
${_conditionType_} a.password is null
</if>
</if>
<if test="conditionParamRef.containsKey('passwordList')">
<if test="conditionParamRef.containsKey('passwordList') and conditionParamRef.passwordList.size() > 0">
${_conditionType_} a.password in
<foreach collection="conditionParamRef.passwordList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('passwordNotList') and conditionParamRef.passwordNotList.size() > 0">
${_conditionType_} a.password not in
<foreach collection="conditionParamRef.passwordNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('memberLevel')">
<if test="conditionParamRef.memberLevel != null ">
${_conditionType_} a.memberLevel = #{${_conditionParam_}.memberLevel}
......@@ -528,12 +661,18 @@
${_conditionType_} a.memberLevel is null
</if>
</if>
<if test="conditionParamRef.containsKey('memberLevelList')">
<if test="conditionParamRef.containsKey('memberLevelList') and conditionParamRef.memberLevelList.size() > 0">
${_conditionType_} a.memberLevel in
<foreach collection="conditionParamRef.memberLevelList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('memberLevelNotList') and conditionParamRef.memberLevelNotList.size() > 0">
${_conditionType_} a.memberLevel not in
<foreach collection="conditionParamRef.memberLevelNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('memberLevelStart') and conditionParamRef.memberLevelStart != null">
${_conditionType_} a.memberLevel <![CDATA[ >= ]]> #{${_conditionParam_}.memberLevelStart}
</if>
......@@ -550,12 +689,18 @@
${_conditionType_} a.custName is null
</if>
</if>
<if test="conditionParamRef.containsKey('custNameList')">
<if test="conditionParamRef.containsKey('custNameList') and conditionParamRef.custNameList.size() > 0">
${_conditionType_} a.custName in
<foreach collection="conditionParamRef.custNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('custNameNotList') and conditionParamRef.custNameNotList.size() > 0">
${_conditionType_} a.custName not in
<foreach collection="conditionParamRef.custNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('organization')">
<if test="conditionParamRef.organization != null and conditionParamRef.organization != ''">
......@@ -565,12 +710,18 @@
${_conditionType_} a.organization is null
</if>
</if>
<if test="conditionParamRef.containsKey('organizationList')">
<if test="conditionParamRef.containsKey('organizationList') and conditionParamRef.organizationList.size() > 0">
${_conditionType_} a.organization in
<foreach collection="conditionParamRef.organizationList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('organizationNotList') and conditionParamRef.organizationNotList.size() > 0">
${_conditionType_} a.organization not in
<foreach collection="conditionParamRef.organizationNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('contactTelphone')">
<if test="conditionParamRef.contactTelphone != null and conditionParamRef.contactTelphone != ''">
......@@ -580,12 +731,18 @@
${_conditionType_} a.contactTelphone is null
</if>
</if>
<if test="conditionParamRef.containsKey('contactTelphoneList')">
<if test="conditionParamRef.containsKey('contactTelphoneList') and conditionParamRef.contactTelphoneList.size() > 0">
${_conditionType_} a.contactTelphone in
<foreach collection="conditionParamRef.contactTelphoneList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('contactTelphoneNotList') and conditionParamRef.contactTelphoneNotList.size() > 0">
${_conditionType_} a.contactTelphone not in
<foreach collection="conditionParamRef.contactTelphoneNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('enterpriseConsultant')">
<if test="conditionParamRef.enterpriseConsultant != null and conditionParamRef.enterpriseConsultant != ''">
......@@ -595,12 +752,18 @@
${_conditionType_} a.enterpriseConsultant is null
</if>
</if>
<if test="conditionParamRef.containsKey('enterpriseConsultantList')">
<if test="conditionParamRef.containsKey('enterpriseConsultantList') and conditionParamRef.enterpriseConsultantList.size() > 0">
${_conditionType_} a.enterpriseConsultant in
<foreach collection="conditionParamRef.enterpriseConsultantList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('enterpriseConsultantNotList') and conditionParamRef.enterpriseConsultantNotList.size() > 0">
${_conditionType_} a.enterpriseConsultant not in
<foreach collection="conditionParamRef.enterpriseConsultantNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteId')">
<if test="conditionParamRef.siteId != null ">
${_conditionType_} a.siteId = #{${_conditionParam_}.siteId}
......@@ -609,12 +772,18 @@
${_conditionType_} a.siteId is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteIdList')">
<if test="conditionParamRef.containsKey('siteIdList') and conditionParamRef.siteIdList.size() > 0">
${_conditionType_} a.siteId in
<foreach collection="conditionParamRef.siteIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdNotList') and conditionParamRef.siteIdNotList.size() > 0">
${_conditionType_} a.siteId not in
<foreach collection="conditionParamRef.siteIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdStart') and conditionParamRef.siteIdStart != null">
${_conditionType_} a.siteId <![CDATA[ >= ]]> #{${_conditionParam_}.siteIdStart}
</if>
......@@ -630,12 +799,18 @@
${_conditionType_} a.sex is null
</if>
</if>
<if test="conditionParamRef.containsKey('sexList')">
<if test="conditionParamRef.containsKey('sexList') and conditionParamRef.sexList.size() > 0">
${_conditionType_} a.sex in
<foreach collection="conditionParamRef.sexList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sexNotList') and conditionParamRef.sexNotList.size() > 0">
${_conditionType_} a.sex not in
<foreach collection="conditionParamRef.sexNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sexStart') and conditionParamRef.sexStart != null">
${_conditionType_} a.sex <![CDATA[ >= ]]> #{${_conditionParam_}.sexStart}
</if>
......@@ -652,12 +827,18 @@
${_conditionType_} a.mailbox is null
</if>
</if>
<if test="conditionParamRef.containsKey('mailboxList')">
<if test="conditionParamRef.containsKey('mailboxList') and conditionParamRef.mailboxList.size() > 0">
${_conditionType_} a.mailbox in
<foreach collection="conditionParamRef.mailboxList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('mailboxNotList') and conditionParamRef.mailboxNotList.size() > 0">
${_conditionType_} a.mailbox not in
<foreach collection="conditionParamRef.mailboxNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('job')">
<if test="conditionParamRef.job != null and conditionParamRef.job != ''">
......@@ -667,12 +848,18 @@
${_conditionType_} a.job is null
</if>
</if>
<if test="conditionParamRef.containsKey('jobList')">
<if test="conditionParamRef.containsKey('jobList') and conditionParamRef.jobList.size() > 0">
${_conditionType_} a.job in
<foreach collection="conditionParamRef.jobList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('jobNotList') and conditionParamRef.jobNotList.size() > 0">
${_conditionType_} a.job not in
<foreach collection="conditionParamRef.jobNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('avatar')">
<if test="conditionParamRef.avatar != null and conditionParamRef.avatar != ''">
......@@ -682,12 +869,18 @@
${_conditionType_} a.avatar is null
</if>
</if>
<if test="conditionParamRef.containsKey('avatarList')">
<if test="conditionParamRef.containsKey('avatarList') and conditionParamRef.avatarList.size() > 0">
${_conditionType_} a.avatar in
<foreach collection="conditionParamRef.avatarList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('avatarNotList') and conditionParamRef.avatarNotList.size() > 0">
${_conditionType_} a.avatar not in
<foreach collection="conditionParamRef.avatarNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerSrc')">
<if test="conditionParamRef.customerSrc != null ">
${_conditionType_} a.customerSrc = #{${_conditionParam_}.customerSrc}
......@@ -696,12 +889,18 @@
${_conditionType_} a.customerSrc is null
</if>
</if>
<if test="conditionParamRef.containsKey('customerSrcList')">
<if test="conditionParamRef.containsKey('customerSrcList') and conditionParamRef.customerSrcList.size() > 0">
${_conditionType_} a.customerSrc in
<foreach collection="conditionParamRef.customerSrcList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerSrcNotList') and conditionParamRef.customerSrcNotList.size() > 0">
${_conditionType_} a.customerSrc not in
<foreach collection="conditionParamRef.customerSrcNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerSrcStart') and conditionParamRef.customerSrcStart != null">
${_conditionType_} a.customerSrc <![CDATA[ >= ]]> #{${_conditionParam_}.customerSrcStart}
</if>
......@@ -717,12 +916,18 @@
${_conditionType_} a.status is null
</if>
</if>
<if test="conditionParamRef.containsKey('statusList')">
<if test="conditionParamRef.containsKey('statusList') and conditionParamRef.statusList.size() > 0">
${_conditionType_} a.status in
<foreach collection="conditionParamRef.statusList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('statusNotList') and conditionParamRef.statusNotList.size() > 0">
${_conditionType_} a.status not in
<foreach collection="conditionParamRef.statusNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('statusStart') and conditionParamRef.statusStart != null">
${_conditionType_} a.status <![CDATA[ >= ]]> #{${_conditionParam_}.statusStart}
</if>
......@@ -738,12 +943,18 @@
${_conditionType_} a.createUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('createUserIdList')">
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
${_conditionType_} a.createUserId in
<foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0">
${_conditionType_} a.createUserId not in
<foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
</if>
......@@ -805,12 +1016,143 @@
${_conditionType_} a.lastLoginAddress is null
</if>
</if>
<if test="conditionParamRef.containsKey('lastLoginAddressList')">
<if test="conditionParamRef.containsKey('lastLoginAddressList') and conditionParamRef.lastLoginAddressList.size() > 0">
${_conditionType_} a.lastLoginAddress in
<foreach collection="conditionParamRef.lastLoginAddressList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('lastLoginAddressNotList') and conditionParamRef.lastLoginAddressNotList.size() > 0">
${_conditionType_} a.lastLoginAddress not in
<foreach collection="conditionParamRef.lastLoginAddressNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('openId')">
<if test="conditionParamRef.openId != null and conditionParamRef.openId != ''">
${_conditionType_} a.openId like #{${_conditionParam_}.openId}
</if>
<if test="conditionParamRef.openId == null">
${_conditionType_} a.openId is null
</if>
</if>
<if test="conditionParamRef.containsKey('openIdList') and conditionParamRef.openIdList.size() > 0">
${_conditionType_} a.openId in
<foreach collection="conditionParamRef.openIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('openIdNotList') and conditionParamRef.openIdNotList.size() > 0">
${_conditionType_} a.openId not in
<foreach collection="conditionParamRef.openIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('saltKey')">
<if test="conditionParamRef.saltKey != null and conditionParamRef.saltKey != ''">
${_conditionType_} a.saltKey like #{${_conditionParam_}.saltKey}
</if>
<if test="conditionParamRef.saltKey == null">
${_conditionType_} a.saltKey is null
</if>
</if>
<if test="conditionParamRef.containsKey('saltKeyList')">
${_conditionType_} a.saltKey in
<foreach collection="conditionParamRef.saltKeyList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('saltKeyNotList')">
${_conditionType_} a.saltKey not in
<foreach collection="conditionParamRef.saltKeyNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('lastUpdatePwdTime')">
<if test="conditionParamRef.lastUpdatePwdTime != null ">
${_conditionType_} a.lastUpdatePwdTime = #{${_conditionParam_}.lastUpdatePwdTime}
</if>
<if test="conditionParamRef.lastUpdatePwdTime == null">
${_conditionType_} a.lastUpdatePwdTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('lastUpdatePwdTimeStart') and conditionParamRef.lastUpdatePwdTimeStart != null and conditionParamRef.lastUpdatePwdTimeStart!=''">
${_conditionType_} a.lastUpdatePwdTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.lastUpdatePwdTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('lastUpdatePwdTimeEnd') and conditionParamRef.lastUpdatePwdTimeEnd != null and conditionParamRef.lastUpdatePwdTimeEnd!=''">
${_conditionType_} a.lastUpdatePwdTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.lastUpdatePwdTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('errorCount')">
<if test="conditionParamRef.errorCount != null ">
${_conditionType_} a.errorCount = #{${_conditionParam_}.errorCount}
</if>
<if test="conditionParamRef.errorCount == null">
${_conditionType_} a.errorCount is null
</if>
</if>
<if test="conditionParamRef.containsKey('errorCountList')">
${_conditionType_} a.errorCount in
<foreach collection="conditionParamRef.errorCountList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('errorCountNotList')">
${_conditionType_} a.errorCount not in
<foreach collection="conditionParamRef.errorCountNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('errorCountStart') and conditionParamRef.errorCountStart != null">
${_conditionType_} a.errorCount <![CDATA[ >= ]]> #{${_conditionParam_}.errorCountStart}
</if>
<if test="conditionParamRef.containsKey('errorCountEnd') and conditionParamRef.errorCountEnd != null">
${_conditionType_} a.errorCount <![CDATA[ <= ]]> #{${_conditionParam_}.errorCountEnd}
</if>
<if test="conditionParamRef.containsKey('loginLock')">
<if test="conditionParamRef.loginLock != null ">
${_conditionType_} a.loginLock = #{${_conditionParam_}.loginLock}
</if>
<if test="conditionParamRef.loginLock == null">
${_conditionType_} a.loginLock is null
</if>
</if>
<if test="conditionParamRef.containsKey('loginLockList')">
${_conditionType_} a.loginLock in
<foreach collection="conditionParamRef.loginLockList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('loginLockNotList')">
${_conditionType_} a.loginLock not in
<foreach collection="conditionParamRef.loginLockNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('loginLockStart') and conditionParamRef.loginLockStart != null">
${_conditionType_} a.loginLock <![CDATA[ >= ]]> #{${_conditionParam_}.loginLockStart}
</if>
<if test="conditionParamRef.containsKey('loginLockEnd') and conditionParamRef.loginLockEnd != null">
${_conditionType_} a.loginLock <![CDATA[ <= ]]> #{${_conditionParam_}.loginLockEnd}
</if>
<if test="conditionParamRef.containsKey('lockTime')">
<if test="conditionParamRef.lockTime != null ">
${_conditionType_} a.lockTime = #{${_conditionParam_}.lockTime}
</if>
<if test="conditionParamRef.lockTime == null">
${_conditionType_} a.lockTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('lockTimeStart') and conditionParamRef.lockTimeStart != null and conditionParamRef.lockTimeStart!=''">
${_conditionType_} a.lockTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.lockTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('lockTimeEnd') and conditionParamRef.lockTimeEnd != null and conditionParamRef.lockTimeEnd!=''">
${_conditionType_} a.lockTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.lockTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -924,6 +1266,36 @@
<if test='orderCol.lastLoginAddress != null and "DESC".equalsIgnoreCase(orderCol.lastLoginAddress)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('openId')">
a.openId
<if test='orderCol.openId != null and "DESC".equalsIgnoreCase(orderCol.openId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('saltKey')">
a.saltKey
<if test='orderCol.saltKey != null and "DESC".equalsIgnoreCase(orderCol.saltKey)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('lastUpdatePwdTime')">
a.lastUpdatePwdTime
<if test='orderCol.lastUpdatePwdTime != null and "DESC".equalsIgnoreCase(orderCol.lastUpdatePwdTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('errorCount')">
a.errorCount
<if test='orderCol.errorCount != null and "DESC".equalsIgnoreCase(orderCol.errorCount)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('loginLock')">
a.loginLock
<if test='orderCol.loginLock != null and "DESC".equalsIgnoreCase(orderCol.loginLock)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('lockTime')">
a.lockTime
<if test='orderCol.lockTime != null and "DESC".equalsIgnoreCase(orderCol.lockTime)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
......@@ -24,6 +24,7 @@
<result property="updateTime" column="updateTime" />
<result property="lastLoginTime" column="lastLoginTime" />
<result property="lastLoginAddress" column="lastLoginAddress" />
<result property="openId" column="openId" />
<result property="customerDesignPictures" column="customerDesignPictures" />
<result property="customerDesignVideos" column="customerDesignVideos" />
</resultMap>
......@@ -67,4 +68,23 @@
</trim>
</select>
<!-- 用户统计 -->
<select id="getCensus" parameterType="paramDto" resultType="com.mortals.xhx.module.customer.model.vo.CustomerCensusVo">
SELECT
memberLevel,
count(id) AS customerCount
FROM
mortals_xhx_customer t
GROUP BY
t.memberLevel
</select>
<!-- 用户统计 -->
<select id="getDesignCensus" parameterType="paramDto" resultType="com.mortals.xhx.module.customer.model.vo.CustomerDesignCensusVo">
SELECT
sum(customerDesignPictures) AS picturesCount,
sum(customerDesignVideos) AS videosCount
FROM
mortals_xhx_customer_work_design_stat
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.customer.dao.ibatis.CustomerWorkCollectDaoImpl">
<!-- 字段和属性映射 -->
<resultMap type="CustomerWorkCollectEntity" id="CustomerWorkCollectEntity-Map">
<id property="id" column="id" />
<result property="customerId" column="customerId" />
<result property="masterplateId" column="masterplateId" />
<result property="createTime" column="createTime" />
<id property="id" column="id" />
<result property="customerId" column="customerId" />
<result property="masterplateId" column="masterplateId" />
<result property="createTime" column="createTime" />
<result property="designType" column="designType" />
</resultMap>
<!-- 表所有列 -->
<sql id="_columns">
<trim suffixOverrides="," suffix="">
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('customerId') or colPickMode == 1 and data.containsKey('customerId')))">
a.customerId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('masterplateId') or colPickMode == 1 and data.containsKey('masterplateId')))">
a.masterplateId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('customerId') or colPickMode == 1 and data.containsKey('customerId')))">
a.customerId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('masterplateId') or colPickMode == 1 and data.containsKey('masterplateId')))">
a.masterplateId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('designType') or colPickMode == 1 and data.containsKey('designType')))">
a.designType,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="CustomerWorkCollectEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_customer_work_collect
(customerId,masterplateId,createTime)
(customerId,masterplateId,createTime,designType)
VALUES
(#{customerId},#{masterplateId},#{createTime})
(#{customerId},#{masterplateId},#{createTime},#{designType})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_customer_work_collect
(customerId,masterplateId,createTime)
(customerId,masterplateId,createTime,designType)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.customerId},#{item.masterplateId},#{item.createTime})
(#{item.customerId},#{item.masterplateId},#{item.createTime},#{item.designType})
</foreach>
</insert>
......@@ -69,6 +73,12 @@
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.createTime=#{data.createTime},
</if>
<if test="(colPickMode==0 and data.containsKey('designType')) or (colPickMode==1 and !data.containsKey('designType'))">
a.designType=#{data.designType},
</if>
<if test="(colPickMode==0 and data.containsKey('designTypeIncrement')) or (colPickMode==1 and !data.containsKey('designTypeIncrement'))">
a.designType=ifnull(a.designType,0) + #{data.designTypeIncrement},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -81,37 +91,49 @@
<update id="updateBatch" parameterType="paramDto">
update mortals_xhx_customer_work_collect as a
<trim prefix="set" suffixOverrides=",">
<trim prefix="customerId=(case" suffix="ELSE customerId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('customerId')) or (colPickMode==1 and !item.containsKey('customerId'))">
when a.id=#{item.id} then #{item.customerId}
</when>
<when test="(colPickMode==0 and item.containsKey('customerIdIncrement')) or (colPickMode==1 and !item.containsKey('customerIdIncrement'))">
when a.id=#{item.id} then ifnull(a.customerId,0) + #{item.customerIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="masterplateId=(case" suffix="ELSE masterplateId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('masterplateId')) or (colPickMode==1 and !item.containsKey('masterplateId'))">
when a.id=#{item.id} then #{item.masterplateId}
</when>
<when test="(colPickMode==0 and item.containsKey('masterplateIdIncrement')) or (colPickMode==1 and !item.containsKey('masterplateIdIncrement'))">
when a.id=#{item.id} then ifnull(a.masterplateId,0) + #{item.masterplateIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="createTime=(case" suffix="ELSE createTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
when a.id=#{item.id} then #{item.createTime}
</if>
</foreach>
</trim>
<trim prefix="customerId=(case" suffix="ELSE customerId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('customerId')) or (colPickMode==1 and !item.containsKey('customerId'))">
when a.id=#{item.id} then #{item.customerId}
</when>
<when test="(colPickMode==0 and item.containsKey('customerIdIncrement')) or (colPickMode==1 and !item.containsKey('customerIdIncrement'))">
when a.id=#{item.id} then ifnull(a.customerId,0) + #{item.customerIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="masterplateId=(case" suffix="ELSE masterplateId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('masterplateId')) or (colPickMode==1 and !item.containsKey('masterplateId'))">
when a.id=#{item.id} then #{item.masterplateId}
</when>
<when test="(colPickMode==0 and item.containsKey('masterplateIdIncrement')) or (colPickMode==1 and !item.containsKey('masterplateIdIncrement'))">
when a.id=#{item.id} then ifnull(a.masterplateId,0) + #{item.masterplateIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="createTime=(case" suffix="ELSE createTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
when a.id=#{item.id} then #{item.createTime}
</if>
</foreach>
</trim>
<trim prefix="designType=(case" suffix="ELSE designType end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('designType')) or (colPickMode==1 and !item.containsKey('designType'))">
when a.id=#{item.id} then #{item.designType}
</when>
<when test="(colPickMode==0 and item.containsKey('designTypeIncrement')) or (colPickMode==1 and !item.containsKey('designTypeIncrement'))">
when a.id=#{item.id} then ifnull(a.designType,0) + #{item.designTypeIncrement}
</when>
</choose>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -135,6 +157,21 @@
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_xhx_customer_work_collect where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_xhx_customer_work_collect where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_customer_work_collect as a
......@@ -213,117 +250,167 @@
${_conditionType_} a.id=#{${_conditionParam_}.id}
</if>
</if>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null ">
${_conditionType_} a.id = #{${_conditionParam_}.id}
</if>
<if test="conditionParamRef.id == null">
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList')">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null ">
${_conditionType_} a.id = #{${_conditionParam_}.id}
</if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
<if test="conditionParamRef.id == null">
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
${_conditionType_} a.id not in
<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
</if>
<if test="conditionParamRef.containsKey('customerId')">
<if test="conditionParamRef.customerId != null ">
${_conditionType_} a.customerId = #{${_conditionParam_}.customerId}
</if>
<if test="conditionParamRef.customerId == null">
${_conditionType_} a.customerId is null
</if>
</if>
<if test="conditionParamRef.containsKey('customerIdList')">
${_conditionType_} a.customerId in
<foreach collection="conditionParamRef.customerIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerIdStart') and conditionParamRef.customerIdStart != null">
${_conditionType_} a.customerId <![CDATA[ >= ]]> #{${_conditionParam_}.customerIdStart}
<if test="conditionParamRef.containsKey('customerId')">
<if test="conditionParamRef.customerId != null ">
${_conditionType_} a.customerId = #{${_conditionParam_}.customerId}
</if>
<if test="conditionParamRef.containsKey('customerIdEnd') and conditionParamRef.customerIdEnd != null">
${_conditionType_} a.customerId <![CDATA[ <= ]]> #{${_conditionParam_}.customerIdEnd}
<if test="conditionParamRef.customerId == null">
${_conditionType_} a.customerId is null
</if>
</if>
<if test="conditionParamRef.containsKey('customerIdList') and conditionParamRef.customerIdList.size() > 0">
${_conditionType_} a.customerId in
<foreach collection="conditionParamRef.customerIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerIdNotList') and conditionParamRef.customerIdNotList.size() > 0">
${_conditionType_} a.customerId not in
<foreach collection="conditionParamRef.customerIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerIdStart') and conditionParamRef.customerIdStart != null">
${_conditionType_} a.customerId <![CDATA[ >= ]]> #{${_conditionParam_}.customerIdStart}
</if>
<if test="conditionParamRef.containsKey('customerIdEnd') and conditionParamRef.customerIdEnd != null">
${_conditionType_} a.customerId <![CDATA[ <= ]]> #{${_conditionParam_}.customerIdEnd}
</if>
<if test="conditionParamRef.containsKey('masterplateId')">
<if test="conditionParamRef.masterplateId != null ">
${_conditionType_} a.masterplateId = #{${_conditionParam_}.masterplateId}
</if>
<if test="conditionParamRef.masterplateId == null">
${_conditionType_} a.masterplateId is null
</if>
</if>
<if test="conditionParamRef.containsKey('masterplateIdList')">
${_conditionType_} a.masterplateId in
<foreach collection="conditionParamRef.masterplateIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
<if test="conditionParamRef.containsKey('masterplateId')">
<if test="conditionParamRef.masterplateId != null ">
${_conditionType_} a.masterplateId = #{${_conditionParam_}.masterplateId}
</if>
<if test="conditionParamRef.containsKey('masterplateIdStart') and conditionParamRef.masterplateIdStart != null">
${_conditionType_} a.masterplateId <![CDATA[ >= ]]> #{${_conditionParam_}.masterplateIdStart}
</if>
<if test="conditionParamRef.containsKey('masterplateIdEnd') and conditionParamRef.masterplateIdEnd != null">
${_conditionType_} a.masterplateId <![CDATA[ <= ]]> #{${_conditionParam_}.masterplateIdEnd}
<if test="conditionParamRef.masterplateId == null">
${_conditionType_} a.masterplateId is null
</if>
</if>
<if test="conditionParamRef.containsKey('masterplateIdList')">
${_conditionType_} a.masterplateId in
<foreach collection="conditionParamRef.masterplateIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateIdNotList') and conditionParamRef.masterplateIdNotList.size() > 0">
${_conditionType_} a.masterplateId not in
<foreach collection="conditionParamRef.masterplateIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateIdStart') and conditionParamRef.masterplateIdStart != null">
${_conditionType_} a.masterplateId <![CDATA[ >= ]]> #{${_conditionParam_}.masterplateIdStart}
</if>
<if test="conditionParamRef.containsKey('masterplateIdEnd') and conditionParamRef.masterplateIdEnd != null">
${_conditionType_} a.masterplateId <![CDATA[ <= ]]> #{${_conditionParam_}.masterplateIdEnd}
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
</if>
<if test="conditionParamRef.createTime == null">
${_conditionType_} a.createTime is null
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
</if>
<if test="conditionParamRef.createTime == null">
${_conditionType_} a.createTime is null
</if>
<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('designType')">
<if test="conditionParamRef.designType != null ">
${_conditionType_} a.designType = #{${_conditionParam_}.designType}
</if>
<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
<if test="conditionParamRef.designType == null">
${_conditionType_} a.designType is null
</if>
</if>
<if test="conditionParamRef.containsKey('designTypeList') and conditionParamRef.designTypeList.size() > 0">
${_conditionType_} a.designType in
<foreach collection="conditionParamRef.designTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('designTypeNotList') and conditionParamRef.designTypeNotList.size() > 0">
${_conditionType_} a.designType not in
<foreach collection="conditionParamRef.designTypeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('designTypeStart') and conditionParamRef.designTypeStart != null">
${_conditionType_} a.designType <![CDATA[ >= ]]> #{${_conditionParam_}.designTypeStart}
</if>
<if test="conditionParamRef.containsKey('designTypeEnd') and conditionParamRef.designTypeEnd != null">
${_conditionType_} a.designType <![CDATA[ <= ]]> #{${_conditionParam_}.designTypeEnd}
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
order by
<trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
${item.colName} ${item.sortKind}
${item.colName} ${item.sortKind}
</foreach>
</trim>
</if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by
<trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')">
a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('customerId')">
a.customerId
<if test='orderCol.customerId != null and "DESC".equalsIgnoreCase(orderCol.customerId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('masterplateId')">
a.masterplateId
<if test='orderCol.masterplateId != null and "DESC".equalsIgnoreCase(orderCol.masterplateId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('id')">
a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('customerId')">
a.customerId
<if test='orderCol.customerId != null and "DESC".equalsIgnoreCase(orderCol.customerId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('masterplateId')">
a.masterplateId
<if test='orderCol.masterplateId != null and "DESC".equalsIgnoreCase(orderCol.masterplateId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('designType')">
a.designType
<if test='orderCol.designType != null and "DESC".equalsIgnoreCase(orderCol.designType)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
......@@ -18,6 +18,7 @@
<result property="fontIds" column="fontIds" />
<result property="previewUrl" column="previewUrl" />
<result property="draft" column="draft" />
<result property="designType" column="designType" />
</resultMap>
......@@ -64,23 +65,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('draft') or colPickMode == 1 and data.containsKey('draft')))">
a.draft,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('designType') or colPickMode == 1 and data.containsKey('designType')))">
a.designType,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="CustomerWorkDesignEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_customer_work_design
(customerId,workDesignName,workDesignStatus,workDesignDesc,createTime,updateTime,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,previewUrl,draft)
(customerId,workDesignName,workDesignStatus,workDesignDesc,createTime,updateTime,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,previewUrl,draft,designType)
VALUES
(#{customerId},#{workDesignName},#{workDesignStatus},#{workDesignDesc},#{createTime},#{updateTime},#{pictureIds},#{pictureSrcIds},#{pictureBackgroundIds},#{fontIds},#{previewUrl},#{draft})
(#{customerId},#{workDesignName},#{workDesignStatus},#{workDesignDesc},#{createTime},#{updateTime},#{pictureIds},#{pictureSrcIds},#{pictureBackgroundIds},#{fontIds},#{previewUrl},#{draft},#{designType})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_customer_work_design
(customerId,workDesignName,workDesignStatus,workDesignDesc,createTime,updateTime,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,previewUrl,draft)
(customerId,workDesignName,workDesignStatus,workDesignDesc,createTime,updateTime,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,previewUrl,draft,designType)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.customerId},#{item.workDesignName},#{item.workDesignStatus},#{item.workDesignDesc},#{item.createTime},#{item.updateTime},#{item.pictureIds},#{item.pictureSrcIds},#{item.pictureBackgroundIds},#{item.fontIds},#{item.previewUrl},#{item.draft})
(#{item.customerId},#{item.workDesignName},#{item.workDesignStatus},#{item.workDesignDesc},#{item.createTime},#{item.updateTime},#{item.pictureIds},#{item.pictureSrcIds},#{item.pictureBackgroundIds},#{item.fontIds},#{item.previewUrl},#{item.draft},#{item.designType})
</foreach>
</insert>
......@@ -132,6 +136,12 @@
<if test="(colPickMode==0 and data.containsKey('draft')) or (colPickMode==1 and !data.containsKey('draft'))">
a.draft=#{data.draft},
</if>
<if test="(colPickMode==0 and data.containsKey('designType')) or (colPickMode==1 and !data.containsKey('designType'))">
a.designType=#{data.designType},
</if>
<if test="(colPickMode==0 and data.containsKey('designTypeIncrement')) or (colPickMode==1 and !data.containsKey('designTypeIncrement'))">
a.designType=ifnull(a.designType,0) + #{data.designTypeIncrement},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -238,6 +248,18 @@
</if>
</foreach>
</trim>
<trim prefix="designType=(case" suffix="ELSE designType end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('designType')) or (colPickMode==1 and !item.containsKey('designType'))">
when a.id=#{item.id} then #{item.designType}
</when>
<when test="(colPickMode==0 and item.containsKey('designTypeIncrement')) or (colPickMode==1 and !item.containsKey('designTypeIncrement'))">
when a.id=#{item.id} then ifnull(a.designType,0) + #{item.designTypeIncrement}
</when>
</choose>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -261,6 +283,21 @@
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_xhx_customer_work_design where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_xhx_customer_work_design where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_customer_work_design as a
......@@ -347,12 +384,18 @@
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList')">
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
${_conditionType_} a.id not in
<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
......@@ -368,12 +411,18 @@
${_conditionType_} a.customerId is null
</if>
</if>
<if test="conditionParamRef.containsKey('customerIdList')">
<if test="conditionParamRef.containsKey('customerIdList') and conditionParamRef.customerIdList.size() > 0">
${_conditionType_} a.customerId in
<foreach collection="conditionParamRef.customerIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerIdNotList') and conditionParamRef.customerIdNotList.size() > 0">
${_conditionType_} a.customerId not in
<foreach collection="conditionParamRef.customerIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerIdStart') and conditionParamRef.customerIdStart != null">
${_conditionType_} a.customerId <![CDATA[ >= ]]> #{${_conditionParam_}.customerIdStart}
</if>
......@@ -390,12 +439,18 @@
${_conditionType_} a.workDesignName is null
</if>
</if>
<if test="conditionParamRef.containsKey('workDesignNameList')">
<if test="conditionParamRef.containsKey('workDesignNameList') and conditionParamRef.workDesignNameList.size() > 0">
${_conditionType_} a.workDesignName in
<foreach collection="conditionParamRef.workDesignNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('workDesignNameNotList') and conditionParamRef.workDesignNameNotList.size() > 0">
${_conditionType_} a.workDesignName not in
<foreach collection="conditionParamRef.workDesignNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('workDesignStatus')">
<if test="conditionParamRef.workDesignStatus != null ">
${_conditionType_} a.workDesignStatus = #{${_conditionParam_}.workDesignStatus}
......@@ -404,12 +459,18 @@
${_conditionType_} a.workDesignStatus is null
</if>
</if>
<if test="conditionParamRef.containsKey('workDesignStatusList')">
<if test="conditionParamRef.containsKey('workDesignStatusList') and conditionParamRef.workDesignStatusList.size() > 0">
${_conditionType_} a.workDesignStatus in
<foreach collection="conditionParamRef.workDesignStatusList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('workDesignStatusNotList') and conditionParamRef.workDesignStatusNotList.size() > 0">
${_conditionType_} a.workDesignStatus not in
<foreach collection="conditionParamRef.workDesignStatusNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('workDesignStatusStart') and conditionParamRef.workDesignStatusStart != null">
${_conditionType_} a.workDesignStatus <![CDATA[ >= ]]> #{${_conditionParam_}.workDesignStatusStart}
</if>
......@@ -426,12 +487,18 @@
${_conditionType_} a.workDesignDesc is null
</if>
</if>
<if test="conditionParamRef.containsKey('workDesignDescList')">
<if test="conditionParamRef.containsKey('workDesignDescList') and conditionParamRef.workDesignDescList.size() > 0">
${_conditionType_} a.workDesignDesc in
<foreach collection="conditionParamRef.workDesignDescList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('workDesignDescNotList') and conditionParamRef.workDesignDescNotList.size() > 0">
${_conditionType_} a.workDesignDesc not in
<foreach collection="conditionParamRef.workDesignDescNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
......@@ -471,12 +538,18 @@
${_conditionType_} a.pictureIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('pictureIdsList')">
<if test="conditionParamRef.containsKey('pictureIdsList') and conditionParamRef.pictureIdsList.size() > 0">
${_conditionType_} a.pictureIds in
<foreach collection="conditionParamRef.pictureIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureIdsNotList') and conditionParamRef.pictureIdsNotList.size() > 0">
${_conditionType_} a.pictureIds not in
<foreach collection="conditionParamRef.pictureIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureSrcIds')">
<if test="conditionParamRef.pictureSrcIds != null and conditionParamRef.pictureSrcIds != ''">
......@@ -486,12 +559,18 @@
${_conditionType_} a.pictureSrcIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('pictureSrcIdsList')">
<if test="conditionParamRef.containsKey('pictureSrcIdsList') and conditionParamRef.pictureSrcIdsList.size() > 0">
${_conditionType_} a.pictureSrcIds in
<foreach collection="conditionParamRef.pictureSrcIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureSrcIdsNotList') and conditionParamRef.pictureSrcIdsNotList.size() > 0">
${_conditionType_} a.pictureSrcIds not in
<foreach collection="conditionParamRef.pictureSrcIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureBackgroundIds')">
<if test="conditionParamRef.pictureBackgroundIds != null and conditionParamRef.pictureBackgroundIds != ''">
......@@ -501,12 +580,18 @@
${_conditionType_} a.pictureBackgroundIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('pictureBackgroundIdsList')">
<if test="conditionParamRef.containsKey('pictureBackgroundIdsList') and conditionParamRef.pictureBackgroundIdsList.size() > 0">
${_conditionType_} a.pictureBackgroundIds in
<foreach collection="conditionParamRef.pictureBackgroundIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureBackgroundIdsNotList') and conditionParamRef.pictureBackgroundIdsNotList.size() > 0">
${_conditionType_} a.pictureBackgroundIds not in
<foreach collection="conditionParamRef.pictureBackgroundIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('fontIds')">
<if test="conditionParamRef.fontIds != null and conditionParamRef.fontIds != ''">
......@@ -516,12 +601,18 @@
${_conditionType_} a.fontIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('fontIdsList')">
<if test="conditionParamRef.containsKey('fontIdsList') and conditionParamRef.fontIdsList.size() > 0">
${_conditionType_} a.fontIds in
<foreach collection="conditionParamRef.fontIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('fontIdsNotList') and conditionParamRef.fontIdsNotList.size() > 0">
${_conditionType_} a.fontIds not in
<foreach collection="conditionParamRef.fontIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('previewUrl')">
<if test="conditionParamRef.previewUrl != null and conditionParamRef.previewUrl != ''">
......@@ -531,12 +622,18 @@
${_conditionType_} a.previewUrl is null
</if>
</if>
<if test="conditionParamRef.containsKey('previewUrlList')">
<if test="conditionParamRef.containsKey('previewUrlList') and conditionParamRef.previewUrlList.size() > 0">
${_conditionType_} a.previewUrl in
<foreach collection="conditionParamRef.previewUrlList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('previewUrlNotList') and conditionParamRef.previewUrlNotList.size() > 0">
${_conditionType_} a.previewUrl not in
<foreach collection="conditionParamRef.previewUrlNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('draft')">
<if test="conditionParamRef.draft != null and conditionParamRef.draft != ''">
......@@ -546,12 +643,45 @@
${_conditionType_} a.draft is null
</if>
</if>
<if test="conditionParamRef.containsKey('draftList')">
<if test="conditionParamRef.containsKey('draftList') and conditionParamRef.draftList.size() > 0">
${_conditionType_} a.draft in
<foreach collection="conditionParamRef.draftList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('draftNotList') and conditionParamRef.draftNotList.size() > 0">
${_conditionType_} a.draft not in
<foreach collection="conditionParamRef.draftNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('designType')">
<if test="conditionParamRef.designType != null ">
${_conditionType_} a.designType = #{${_conditionParam_}.designType}
</if>
<if test="conditionParamRef.designType == null">
${_conditionType_} a.designType is null
</if>
</if>
<if test="conditionParamRef.containsKey('designTypeList') and conditionParamRef.designTypeList.size() > 0">
${_conditionType_} a.designType in
<foreach collection="conditionParamRef.designTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('designTypeNotList') and conditionParamRef.designTypeNotList.size() > 0">
${_conditionType_} a.designType not in
<foreach collection="conditionParamRef.designTypeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('designTypeStart') and conditionParamRef.designTypeStart != null">
${_conditionType_} a.designType <![CDATA[ >= ]]> #{${_conditionParam_}.designTypeStart}
</if>
<if test="conditionParamRef.containsKey('designTypeEnd') and conditionParamRef.designTypeEnd != null">
${_conditionType_} a.designType <![CDATA[ <= ]]> #{${_conditionParam_}.designTypeEnd}
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -630,6 +760,11 @@
<if test='orderCol.draft != null and "DESC".equalsIgnoreCase(orderCol.draft)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('designType')">
a.designType
<if test='orderCol.designType != null and "DESC".equalsIgnoreCase(orderCol.designType)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
......@@ -21,6 +21,7 @@
<result property="previewUrl" column="previewUrl" />
<result property="draft" column="draft" />
<result property="plateType" column="plateType" />
<result property="designType" column="designType" />
</resultMap>
......@@ -76,23 +77,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('plateType') or colPickMode == 1 and data.containsKey('plateType')))">
a.plateType,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('designType') or colPickMode == 1 and data.containsKey('designType')))">
a.designType,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DesignMasterplateEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_design_masterplate
(masterplateName,masterplateCode,customerId,customerName,createTime,masterplateDesc,masterplatePath,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,masterplateUseNum,previewUrl,draft,plateType)
(masterplateName,masterplateCode,customerId,customerName,createTime,masterplateDesc,masterplatePath,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,masterplateUseNum,previewUrl,draft,plateType,designType)
VALUES
(#{masterplateName},#{masterplateCode},#{customerId},#{customerName},#{createTime},#{masterplateDesc},#{masterplatePath},#{pictureIds},#{pictureSrcIds},#{pictureBackgroundIds},#{fontIds},#{masterplateUseNum},#{previewUrl},#{draft},#{plateType})
(#{masterplateName},#{masterplateCode},#{customerId},#{customerName},#{createTime},#{masterplateDesc},#{masterplatePath},#{pictureIds},#{pictureSrcIds},#{pictureBackgroundIds},#{fontIds},#{masterplateUseNum},#{previewUrl},#{draft},#{plateType},#{designType})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_design_masterplate
(masterplateName,masterplateCode,customerId,customerName,createTime,masterplateDesc,masterplatePath,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,masterplateUseNum,previewUrl,draft,plateType)
(masterplateName,masterplateCode,customerId,customerName,createTime,masterplateDesc,masterplatePath,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,masterplateUseNum,previewUrl,draft,plateType,designType)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.masterplateName},#{item.masterplateCode},#{item.customerId},#{item.customerName},#{item.createTime},#{item.masterplateDesc},#{item.masterplatePath},#{item.pictureIds},#{item.pictureSrcIds},#{item.pictureBackgroundIds},#{item.fontIds},#{item.masterplateUseNum},#{item.previewUrl},#{item.draft},#{item.plateType})
(#{item.masterplateName},#{item.masterplateCode},#{item.customerId},#{item.customerName},#{item.createTime},#{item.masterplateDesc},#{item.masterplatePath},#{item.pictureIds},#{item.pictureSrcIds},#{item.pictureBackgroundIds},#{item.fontIds},#{item.masterplateUseNum},#{item.previewUrl},#{item.draft},#{item.plateType},#{item.designType})
</foreach>
</insert>
......@@ -159,6 +163,12 @@
<if test="(colPickMode==0 and data.containsKey('plateTypeIncrement')) or (colPickMode==1 and !data.containsKey('plateTypeIncrement'))">
a.plateType=ifnull(a.plateType,0) + #{data.plateTypeIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('designType')) or (colPickMode==1 and !data.containsKey('designType'))">
a.designType=#{data.designType},
</if>
<if test="(colPickMode==0 and data.containsKey('designTypeIncrement')) or (colPickMode==1 and !data.containsKey('designTypeIncrement'))">
a.designType=ifnull(a.designType,0) + #{data.designTypeIncrement},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -296,6 +306,18 @@
</choose>
</foreach>
</trim>
<trim prefix="designType=(case" suffix="ELSE designType end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('designType')) or (colPickMode==1 and !item.containsKey('designType'))">
when a.id=#{item.id} then #{item.designType}
</when>
<when test="(colPickMode==0 and item.containsKey('designTypeIncrement')) or (colPickMode==1 and !item.containsKey('designTypeIncrement'))">
when a.id=#{item.id} then ifnull(a.designType,0) + #{item.designTypeIncrement}
</when>
</choose>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -319,6 +341,21 @@
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_xhx_design_masterplate where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_xhx_design_masterplate where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_design_masterplate as a
......@@ -405,12 +442,18 @@
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList')">
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
${_conditionType_} a.id not in
<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
......@@ -427,12 +470,18 @@
${_conditionType_} a.masterplateName is null
</if>
</if>
<if test="conditionParamRef.containsKey('masterplateNameList')">
<if test="conditionParamRef.containsKey('masterplateNameList') and conditionParamRef.masterplateNameList.size() > 0">
${_conditionType_} a.masterplateName in
<foreach collection="conditionParamRef.masterplateNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateNameNotList') and conditionParamRef.masterplateNameNotList.size() > 0">
${_conditionType_} a.masterplateName not in
<foreach collection="conditionParamRef.masterplateNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateCode')">
<if test="conditionParamRef.masterplateCode != null ">
${_conditionType_} a.masterplateCode = #{${_conditionParam_}.masterplateCode}
......@@ -441,12 +490,18 @@
${_conditionType_} a.masterplateCode is null
</if>
</if>
<if test="conditionParamRef.containsKey('masterplateCodeList')">
<if test="conditionParamRef.containsKey('masterplateCodeList') and conditionParamRef.masterplateCodeList.size() > 0">
${_conditionType_} a.masterplateCode in
<foreach collection="conditionParamRef.masterplateCodeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateCodeNotList') and conditionParamRef.masterplateCodeNotList.size() > 0">
${_conditionType_} a.masterplateCode not in
<foreach collection="conditionParamRef.masterplateCodeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateCodeStart') and conditionParamRef.masterplateCodeStart != null">
${_conditionType_} a.masterplateCode <![CDATA[ >= ]]> #{${_conditionParam_}.masterplateCodeStart}
</if>
......@@ -462,12 +517,18 @@
${_conditionType_} a.customerId is null
</if>
</if>
<if test="conditionParamRef.containsKey('customerIdList')">
<if test="conditionParamRef.containsKey('customerIdList') and conditionParamRef.customerIdList.size() > 0">
${_conditionType_} a.customerId in
<foreach collection="conditionParamRef.customerIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerIdNotList') and conditionParamRef.customerIdNotList.size() > 0">
${_conditionType_} a.customerId not in
<foreach collection="conditionParamRef.customerIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerIdStart') and conditionParamRef.customerIdStart != null">
${_conditionType_} a.customerId <![CDATA[ >= ]]> #{${_conditionParam_}.customerIdStart}
</if>
......@@ -484,12 +545,18 @@
${_conditionType_} a.customerName is null
</if>
</if>
<if test="conditionParamRef.containsKey('customerNameList')">
<if test="conditionParamRef.containsKey('customerNameList') and conditionParamRef.customerNameList.size() > 0">
${_conditionType_} a.customerName in
<foreach collection="conditionParamRef.customerNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('customerNameNotList') and conditionParamRef.customerNameNotList.size() > 0">
${_conditionType_} a.customerName not in
<foreach collection="conditionParamRef.customerNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
......@@ -514,12 +581,18 @@
${_conditionType_} a.masterplateDesc is null
</if>
</if>
<if test="conditionParamRef.containsKey('masterplateDescList')">
<if test="conditionParamRef.containsKey('masterplateDescList') and conditionParamRef.masterplateDescList.size() > 0">
${_conditionType_} a.masterplateDesc in
<foreach collection="conditionParamRef.masterplateDescList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateDescNotList') and conditionParamRef.masterplateDescNotList.size() > 0">
${_conditionType_} a.masterplateDesc not in
<foreach collection="conditionParamRef.masterplateDescNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplatePath')">
<if test="conditionParamRef.masterplatePath != null and conditionParamRef.masterplatePath != ''">
......@@ -529,12 +602,18 @@
${_conditionType_} a.masterplatePath is null
</if>
</if>
<if test="conditionParamRef.containsKey('masterplatePathList')">
<if test="conditionParamRef.containsKey('masterplatePathList') and conditionParamRef.masterplatePathList.size() > 0">
${_conditionType_} a.masterplatePath in
<foreach collection="conditionParamRef.masterplatePathList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplatePathNotList') and conditionParamRef.masterplatePathNotList.size() > 0">
${_conditionType_} a.masterplatePath not in
<foreach collection="conditionParamRef.masterplatePathNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureIds')">
<if test="conditionParamRef.pictureIds != null and conditionParamRef.pictureIds != ''">
......@@ -544,12 +623,18 @@
${_conditionType_} a.pictureIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('pictureIdsList')">
<if test="conditionParamRef.containsKey('pictureIdsList') and conditionParamRef.pictureIdsList.size() > 0">
${_conditionType_} a.pictureIds in
<foreach collection="conditionParamRef.pictureIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureIdsNotList') and conditionParamRef.pictureIdsNotList.size() > 0">
${_conditionType_} a.pictureIds not in
<foreach collection="conditionParamRef.pictureIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureSrcIds')">
<if test="conditionParamRef.pictureSrcIds != null and conditionParamRef.pictureSrcIds != ''">
......@@ -559,12 +644,18 @@
${_conditionType_} a.pictureSrcIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('pictureSrcIdsList')">
<if test="conditionParamRef.containsKey('pictureSrcIdsList') and conditionParamRef.pictureSrcIdsList.size() > 0">
${_conditionType_} a.pictureSrcIds in
<foreach collection="conditionParamRef.pictureSrcIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureSrcIdsNotList') and conditionParamRef.pictureSrcIdsNotList.size() > 0">
${_conditionType_} a.pictureSrcIds not in
<foreach collection="conditionParamRef.pictureSrcIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureBackgroundIds')">
<if test="conditionParamRef.pictureBackgroundIds != null and conditionParamRef.pictureBackgroundIds != ''">
......@@ -574,12 +665,18 @@
${_conditionType_} a.pictureBackgroundIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('pictureBackgroundIdsList')">
<if test="conditionParamRef.containsKey('pictureBackgroundIdsList') and conditionParamRef.pictureBackgroundIdsList.size() > 0">
${_conditionType_} a.pictureBackgroundIds in
<foreach collection="conditionParamRef.pictureBackgroundIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('pictureBackgroundIdsNotList') and conditionParamRef.pictureBackgroundIdsNotList.size() > 0">
${_conditionType_} a.pictureBackgroundIds not in
<foreach collection="conditionParamRef.pictureBackgroundIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('fontIds')">
<if test="conditionParamRef.fontIds != null and conditionParamRef.fontIds != ''">
......@@ -589,12 +686,18 @@
${_conditionType_} a.fontIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('fontIdsList')">
<if test="conditionParamRef.containsKey('fontIdsList') and conditionParamRef.fontIdsList.size() > 0">
${_conditionType_} a.fontIds in
<foreach collection="conditionParamRef.fontIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('fontIdsNotList') and conditionParamRef.fontIdsNotList.size() > 0">
${_conditionType_} a.fontIds not in
<foreach collection="conditionParamRef.fontIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateUseNum')">
<if test="conditionParamRef.masterplateUseNum != null ">
${_conditionType_} a.masterplateUseNum = #{${_conditionParam_}.masterplateUseNum}
......@@ -603,12 +706,18 @@
${_conditionType_} a.masterplateUseNum is null
</if>
</if>
<if test="conditionParamRef.containsKey('masterplateUseNumList')">
<if test="conditionParamRef.containsKey('masterplateUseNumList') and conditionParamRef.masterplateUseNumList.size() > 0">
${_conditionType_} a.masterplateUseNum in
<foreach collection="conditionParamRef.masterplateUseNumList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateUseNumNotList') and conditionParamRef.masterplateUseNumNotList.size() > 0">
${_conditionType_} a.masterplateUseNum not in
<foreach collection="conditionParamRef.masterplateUseNumNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('masterplateUseNumStart') and conditionParamRef.masterplateUseNumStart != null">
${_conditionType_} a.masterplateUseNum <![CDATA[ >= ]]> #{${_conditionParam_}.masterplateUseNumStart}
</if>
......@@ -625,12 +734,18 @@
${_conditionType_} a.previewUrl is null
</if>
</if>
<if test="conditionParamRef.containsKey('previewUrlList')">
<if test="conditionParamRef.containsKey('previewUrlList') and conditionParamRef.previewUrlList.size() > 0">
${_conditionType_} a.previewUrl in
<foreach collection="conditionParamRef.previewUrlList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('previewUrlNotList') and conditionParamRef.previewUrlNotList.size() > 0">
${_conditionType_} a.previewUrl not in
<foreach collection="conditionParamRef.previewUrlNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('draft')">
<if test="conditionParamRef.draft != null and conditionParamRef.draft != ''">
......@@ -640,12 +755,18 @@
${_conditionType_} a.draft is null
</if>
</if>
<if test="conditionParamRef.containsKey('draftList')">
<if test="conditionParamRef.containsKey('draftList') and conditionParamRef.draftList.size() > 0">
${_conditionType_} a.draft in
<foreach collection="conditionParamRef.draftList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('draftNotList') and conditionParamRef.draftNotList.size() > 0">
${_conditionType_} a.draft not in
<foreach collection="conditionParamRef.draftNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('plateType')">
<if test="conditionParamRef.plateType != null ">
${_conditionType_} a.plateType = #{${_conditionParam_}.plateType}
......@@ -654,12 +775,18 @@
${_conditionType_} a.plateType is null
</if>
</if>
<if test="conditionParamRef.containsKey('plateTypeList')">
<if test="conditionParamRef.containsKey('plateTypeList') and conditionParamRef.plateTypeList.size() > 0">
${_conditionType_} a.plateType in
<foreach collection="conditionParamRef.plateTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('plateTypeNotList') and conditionParamRef.plateTypeNotList.size() > 0">
${_conditionType_} a.plateType not in
<foreach collection="conditionParamRef.plateTypeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('plateTypeStart') and conditionParamRef.plateTypeStart != null">
${_conditionType_} a.plateType <![CDATA[ >= ]]> #{${_conditionParam_}.plateTypeStart}
</if>
......@@ -667,6 +794,33 @@
${_conditionType_} a.plateType <![CDATA[ <= ]]> #{${_conditionParam_}.plateTypeEnd}
</if>
<if test="conditionParamRef.containsKey('designType')">
<if test="conditionParamRef.designType != null ">
${_conditionType_} a.designType = #{${_conditionParam_}.designType}
</if>
<if test="conditionParamRef.designType == null">
${_conditionType_} a.designType is null
</if>
</if>
<if test="conditionParamRef.containsKey('designTypeList') and conditionParamRef.designTypeList.size() > 0">
${_conditionType_} a.designType in
<foreach collection="conditionParamRef.designTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('designTypeNotList') and conditionParamRef.designTypeNotList.size() > 0">
${_conditionType_} a.designType not in
<foreach collection="conditionParamRef.designTypeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('designTypeStart') and conditionParamRef.designTypeStart != null">
${_conditionType_} a.designType <![CDATA[ >= ]]> #{${_conditionParam_}.designTypeStart}
</if>
<if test="conditionParamRef.containsKey('designTypeEnd') and conditionParamRef.designTypeEnd != null">
${_conditionType_} a.designType <![CDATA[ <= ]]> #{${_conditionParam_}.designTypeEnd}
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -760,6 +914,11 @@
<if test='orderCol.plateType != null and "DESC".equalsIgnoreCase(orderCol.plateType)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('designType')">
a.designType
<if test='orderCol.designType != null and "DESC".equalsIgnoreCase(orderCol.designType)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment