Commit cde9db23 authored by 赵啸非's avatar 赵啸非

添加皮肤同步

parent 139bb839
package com.mortals.xhx.common.pdu.skin;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
/**
* 系统基础皮肤Pdu对象
*
* @author zxfei
* @date 2023-04-03
*/
@Data
public class SkinBasePdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 所属种类,来源种类
*/
private Long categoryId;
/**
* 产品id
*/
private Long productId;
/**
* 产品编码
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* css模板合成后文件地址
*/
private String cssFilePath;
/**
* 排序编号
*/
private Integer sortNum;
/**
* 产品皮肤名称,唯一且不为空
*/
private String name;
/**
* 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*/
private String imageResolution;
/**
* 预览图片
*/
private String previewImagePath;
public void initAttrValue(){
this.categoryId = null;
this.productId = null;
this.productName = "";
this.cssFilePath = "";
this.sortNum = null;
this.name = "";
this.imageResolution = "1";
this.previewImagePath = "";
}
}
\ No newline at end of file
package com.mortals.xhx.feign.skin;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.skin.SkinBasePdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 系统基础皮肤 Feign接口
* @author zxfei
* @date 2023-04-03
*/
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = SkinBaseFeignFallbackFactory.class)
public interface ISkinBaseFeign extends IFeign {
/**
* 查看系统基础皮肤列表
*
* @param skinBasePdu
* @return
*/
@PostMapping(value = "/skin/base/interlist")
Rest<RespData<List<SkinBasePdu>>> list(@RequestBody SkinBasePdu skinBasePdu);
/**
* 查看系统基础皮肤
*
* @param id
* @return
*/
@GetMapping(value = "/skin/base/info")
Rest<SkinBasePdu> info(@RequestParam(value = "id") Long id);
/**
* 删除系统基础皮肤
*
* @param ids
* @return
*/
@GetMapping(value = "/skin/base/delete")
Rest<Void> delete(Long[] ids,@RequestHeader("Authorization") String authorization);
/**
* 系统基础皮肤保存更新
*
* @param skinBasePdu
* @return
*/
@PostMapping(value = "/skin/base/save")
Rest<RespData<SkinBasePdu>> save(@RequestBody SkinBasePdu skinBasePdu,@RequestHeader("Authorization") String authorization);
}
@Slf4j
@Component
class SkinBaseFeignFallbackFactory implements FallbackFactory<ISkinBaseFeign> {
@Override
public ISkinBaseFeign create(Throwable t) {
return new ISkinBaseFeign() {
@Override
public Rest<RespData<List<SkinBasePdu>>> list(SkinBasePdu skinBasePdu) {
return Rest.fail("暂时无法获取系统基础皮肤列表,请稍后再试!");
}
@Override
public Rest<SkinBasePdu> info(Long id) {
return Rest.fail("暂时无法获取系统基础皮肤详细,请稍后再试!");
}
@Override
public Rest<Void> delete(Long[] ids, String authorization) {
return Rest.fail("暂时无法删除系统基础皮肤,请稍后再试!");
}
@Override
public Rest<RespData<SkinBasePdu>> save(SkinBasePdu skinBasePdu, String authorization) {
return Rest.fail("暂时无法保存系统基础皮肤,请稍后再试!");
}
};
}
}
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
return { return {
filePaths:"", filePaths:"",
fileNames:"", fileNames:"",
limit:10, limit:50,
deviceFileEntityList: [], deviceFileEntityList: [],
deviceWorkmanEntityList:[], deviceWorkmanEntityList:[],
fileType:['png', 'jpg', 'jpeg'], fileType:['png', 'jpg', 'jpeg'],
......
...@@ -16,6 +16,7 @@ import com.mortals.xhx.feign.site.ISiteFeign; ...@@ -16,6 +16,7 @@ import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceQuery; import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.service.DeviceService; import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.skin.service.SkinService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -40,7 +41,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -40,7 +41,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
private IDeviceFeign deviceFeign; private IDeviceFeign deviceFeign;
@Autowired @Autowired
private DeviceService deviceService; private DeviceService deviceService;
@Autowired
private SkinService skinService;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
...@@ -48,6 +50,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -48,6 +50,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
syncDevice(); syncDevice();
log.info("结束同步设备列表!"); log.info("结束同步设备列表!");
skinService.syncSkin();
log.info("开始同步皮肤列表!"); log.info("开始同步皮肤列表!");
} }
......
package com.mortals.xhx.module.skin.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.skin.model.SkinEntity;
/**
* 皮肤Dao
* 皮肤 DAO接口
*
* @author zxfei
* @date 2023-04-03
*/
public interface SkinDao extends ICRUDDao<SkinEntity,Long>{
}
package com.mortals.xhx.module.skin.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.skin.dao.SkinDao;
import com.mortals.xhx.module.skin.model.SkinEntity;
import org.springframework.stereotype.Repository;
/**
* 皮肤DaoImpl DAO接口
*
* @author zxfei
* @date 2023-04-03
*/
@Repository("skinDao")
public class SkinDaoImpl extends BaseCRUDDaoMybatis<SkinEntity,Long> implements SkinDao {
}
package com.mortals.xhx.module.skin.model;
import com.mortals.xhx.module.skin.model.vo.SkinVo;
/**
* 皮肤实体对象
*
* @author zxfei
* @date 2023-04-03
*/
public class SkinEntity extends SkinVo {
private static final long serialVersionUID = 1L;
/**
* 所属种类,来源种类
*/
private Long categoryId;
/**
* 产品id
*/
private Long productId;
/**
* 产品名称
*/
private String productName;
/**
* css模板合成后文件地址
*/
private String cssFilePath;
/**
* 产品皮肤名称,唯一且不为空
*/
private String name;
/**
* 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*/
private String imageResolution;
/**
* 预览图片
*/
private String previewImagePath;
/**
* 排序编号
*/
private Integer sortNum;
/**
* 是否使用
*/
private Integer used;
public SkinEntity(){}
/**
* 获取 所属种类,来源种类
* @return Long
*/
public Long getCategoryId(){
return categoryId;
}
/**
* 设置 所属种类,来源种类
* @param categoryId
*/
public void setCategoryId(Long categoryId){
this.categoryId = categoryId;
}
/**
* 获取 产品id
* @return Long
*/
public Long getProductId(){
return productId;
}
/**
* 设置 产品id
* @param productId
*/
public void setProductId(Long productId){
this.productId = productId;
}
/**
* 获取 产品名称
* @return String
*/
public String getProductName(){
return productName;
}
/**
* 设置 产品名称
* @param productName
*/
public void setProductName(String productName){
this.productName = productName;
}
/**
* 获取 css模板合成后文件地址
* @return String
*/
public String getCssFilePath(){
return cssFilePath;
}
/**
* 设置 css模板合成后文件地址
* @param cssFilePath
*/
public void setCssFilePath(String cssFilePath){
this.cssFilePath = cssFilePath;
}
/**
* 获取 产品皮肤名称,唯一且不为空
* @return String
*/
public String getName(){
return name;
}
/**
* 设置 产品皮肤名称,唯一且不为空
* @param name
*/
public void setName(String name){
this.name = name;
}
/**
* 获取 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @return String
*/
public String getImageResolution(){
return imageResolution;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @param imageResolution
*/
public void setImageResolution(String imageResolution){
this.imageResolution = imageResolution;
}
/**
* 获取 预览图片
* @return String
*/
public String getPreviewImagePath(){
return previewImagePath;
}
/**
* 设置 预览图片
* @param previewImagePath
*/
public void setPreviewImagePath(String previewImagePath){
this.previewImagePath = previewImagePath;
}
/**
* 获取 排序编号
* @return Integer
*/
public Integer getSortNum(){
return sortNum;
}
/**
* 设置 排序编号
* @param sortNum
*/
public void setSortNum(Integer sortNum){
this.sortNum = sortNum;
}
/**
* 获取 是否使用
* @return Integer
*/
public Integer getUsed(){
return used;
}
/**
* 设置 是否使用
* @param used
*/
public void setUsed(Integer used){
this.used = used;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof SkinEntity) {
SkinEntity tmp = (SkinEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",categoryId:").append(getCategoryId());
sb.append(",productId:").append(getProductId());
sb.append(",productName:").append(getProductName());
sb.append(",cssFilePath:").append(getCssFilePath());
sb.append(",name:").append(getName());
sb.append(",imageResolution:").append(getImageResolution());
sb.append(",previewImagePath:").append(getPreviewImagePath());
sb.append(",sortNum:").append(getSortNum());
sb.append(",used:").append(getUsed());
return sb.toString();
}
public void initAttrValue(){
this.categoryId = null;
this.productId = null;
this.productName = null;
this.cssFilePath = null;
this.name = null;
this.imageResolution = null;
this.previewImagePath = null;
this.sortNum = null;
this.used = 0;
}
}
\ No newline at end of file
package com.mortals.xhx.module.skin.model;
import java.util.List;
/**
* 皮肤查询对象
*
* @author zxfei
* @date 2023-04-03
*/
public class SkinQuery extends SkinEntity {
/** 开始 序号,主键,自增长 */
private Long idStart;
/** 结束 序号,主键,自增长 */
private Long idEnd;
/** 增加 序号,主键,自增长 */
private Long idIncrement;
/** 序号,主键,自增长列表 */
private List <Long> idList;
/** 序号,主键,自增长排除列表 */
private List <Long> idNotList;
/** 开始 所属种类,来源种类 */
private Long categoryIdStart;
/** 结束 所属种类,来源种类 */
private Long categoryIdEnd;
/** 增加 所属种类,来源种类 */
private Long categoryIdIncrement;
/** 所属种类,来源种类列表 */
private List <Long> categoryIdList;
/** 所属种类,来源种类排除列表 */
private List <Long> categoryIdNotList;
/** 开始 产品id */
private Long productIdStart;
/** 结束 产品id */
private Long productIdEnd;
/** 增加 产品id */
private Long productIdIncrement;
/** 产品id列表 */
private List <Long> productIdList;
/** 产品id排除列表 */
private List <Long> productIdNotList;
/** 产品名称 */
private List<String> productNameList;
/** 产品名称排除列表 */
private List <String> productNameNotList;
/** css模板合成后文件地址 */
private List<String> cssFilePathList;
/** css模板合成后文件地址排除列表 */
private List <String> cssFilePathNotList;
/** 产品皮肤名称,唯一且不为空 */
private List<String> nameList;
/** 产品皮肤名称,唯一且不为空排除列表 */
private List <String> nameNotList;
/** 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280) */
private List<String> imageResolutionList;
/** 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)排除列表 */
private List <String> imageResolutionNotList;
/** 预览图片 */
private List<String> previewImagePathList;
/** 预览图片排除列表 */
private List <String> previewImagePathNotList;
/** 开始 排序编号 */
private Integer sortNumStart;
/** 结束 排序编号 */
private Integer sortNumEnd;
/** 增加 排序编号 */
private Integer sortNumIncrement;
/** 排序编号列表 */
private List <Integer> sortNumList;
/** 排序编号排除列表 */
private List <Integer> sortNumNotList;
/** 开始 是否使用 */
private Integer usedStart;
/** 结束 是否使用 */
private Integer usedEnd;
/** 增加 是否使用 */
private Integer usedIncrement;
/** 是否使用列表 */
private List <Integer> usedList;
/** 是否使用排除列表 */
private List <Integer> usedNotList;
/** 开始 创建时间 */
private String createTimeStart;
/** 结束 创建时间 */
private String createTimeEnd;
/** 开始 创建用户 */
private Long createUserIdStart;
/** 结束 创建用户 */
private Long createUserIdEnd;
/** 增加 创建用户 */
private Long createUserIdIncrement;
/** 创建用户列表 */
private List <Long> createUserIdList;
/** 创建用户排除列表 */
private List <Long> createUserIdNotList;
/** 开始 修改时间 */
private String updateTimeStart;
/** 结束 修改时间 */
private String updateTimeEnd;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<SkinQuery> orConditionList;
/** AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */
private List<SkinQuery> andConditionList;
public SkinQuery(){}
/**
* 获取 开始 序号,主键,自增长
* @return idStart
*/
public Long getIdStart(){
return this.idStart;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public void setIdStart(Long idStart){
this.idStart = idStart;
}
/**
* 获取 结束 序号,主键,自增长
* @return $idEnd
*/
public Long getIdEnd(){
return this.idEnd;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public void setIdEnd(Long idEnd){
this.idEnd = idEnd;
}
/**
* 获取 增加 序号,主键,自增长
* @return idIncrement
*/
public Long getIdIncrement(){
return this.idIncrement;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public void setIdIncrement(Long idIncrement){
this.idIncrement = idIncrement;
}
/**
* 获取 序号,主键,自增长
* @return idList
*/
public List<Long> getIdList(){
return this.idList;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public void setIdList(List<Long> idList){
this.idList = idList;
}
/**
* 获取 序号,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 开始 所属种类,来源种类
* @return categoryIdStart
*/
public Long getCategoryIdStart(){
return this.categoryIdStart;
}
/**
* 设置 开始 所属种类,来源种类
* @param categoryIdStart
*/
public void setCategoryIdStart(Long categoryIdStart){
this.categoryIdStart = categoryIdStart;
}
/**
* 获取 结束 所属种类,来源种类
* @return $categoryIdEnd
*/
public Long getCategoryIdEnd(){
return this.categoryIdEnd;
}
/**
* 设置 结束 所属种类,来源种类
* @param categoryIdEnd
*/
public void setCategoryIdEnd(Long categoryIdEnd){
this.categoryIdEnd = categoryIdEnd;
}
/**
* 获取 增加 所属种类,来源种类
* @return categoryIdIncrement
*/
public Long getCategoryIdIncrement(){
return this.categoryIdIncrement;
}
/**
* 设置 增加 所属种类,来源种类
* @param categoryIdIncrement
*/
public void setCategoryIdIncrement(Long categoryIdIncrement){
this.categoryIdIncrement = categoryIdIncrement;
}
/**
* 获取 所属种类,来源种类
* @return categoryIdList
*/
public List<Long> getCategoryIdList(){
return this.categoryIdList;
}
/**
* 设置 所属种类,来源种类
* @param categoryIdList
*/
public void setCategoryIdList(List<Long> categoryIdList){
this.categoryIdList = categoryIdList;
}
/**
* 获取 所属种类,来源种类
* @return categoryIdNotList
*/
public List<Long> getCategoryIdNotList(){
return this.categoryIdNotList;
}
/**
* 设置 所属种类,来源种类
* @param categoryIdNotList
*/
public void setCategoryIdNotList(List<Long> categoryIdNotList){
this.categoryIdNotList = categoryIdNotList;
}
/**
* 获取 开始 产品id
* @return productIdStart
*/
public Long getProductIdStart(){
return this.productIdStart;
}
/**
* 设置 开始 产品id
* @param productIdStart
*/
public void setProductIdStart(Long productIdStart){
this.productIdStart = productIdStart;
}
/**
* 获取 结束 产品id
* @return $productIdEnd
*/
public Long getProductIdEnd(){
return this.productIdEnd;
}
/**
* 设置 结束 产品id
* @param productIdEnd
*/
public void setProductIdEnd(Long productIdEnd){
this.productIdEnd = productIdEnd;
}
/**
* 获取 增加 产品id
* @return productIdIncrement
*/
public Long getProductIdIncrement(){
return this.productIdIncrement;
}
/**
* 设置 增加 产品id
* @param productIdIncrement
*/
public void setProductIdIncrement(Long productIdIncrement){
this.productIdIncrement = productIdIncrement;
}
/**
* 获取 产品id
* @return productIdList
*/
public List<Long> getProductIdList(){
return this.productIdList;
}
/**
* 设置 产品id
* @param productIdList
*/
public void setProductIdList(List<Long> productIdList){
this.productIdList = productIdList;
}
/**
* 获取 产品id
* @return productIdNotList
*/
public List<Long> getProductIdNotList(){
return this.productIdNotList;
}
/**
* 设置 产品id
* @param productIdNotList
*/
public void setProductIdNotList(List<Long> productIdNotList){
this.productIdNotList = productIdNotList;
}
/**
* 获取 产品名称
* @return productNameList
*/
public List<String> getProductNameList(){
return this.productNameList;
}
/**
* 设置 产品名称
* @param productNameList
*/
public void setProductNameList(List<String> productNameList){
this.productNameList = productNameList;
}
/**
* 获取 产品名称
* @return productNameNotList
*/
public List<String> getProductNameNotList(){
return this.productNameNotList;
}
/**
* 设置 产品名称
* @param productNameNotList
*/
public void setProductNameNotList(List<String> productNameNotList){
this.productNameNotList = productNameNotList;
}
/**
* 获取 css模板合成后文件地址
* @return cssFilePathList
*/
public List<String> getCssFilePathList(){
return this.cssFilePathList;
}
/**
* 设置 css模板合成后文件地址
* @param cssFilePathList
*/
public void setCssFilePathList(List<String> cssFilePathList){
this.cssFilePathList = cssFilePathList;
}
/**
* 获取 css模板合成后文件地址
* @return cssFilePathNotList
*/
public List<String> getCssFilePathNotList(){
return this.cssFilePathNotList;
}
/**
* 设置 css模板合成后文件地址
* @param cssFilePathNotList
*/
public void setCssFilePathNotList(List<String> cssFilePathNotList){
this.cssFilePathNotList = cssFilePathNotList;
}
/**
* 获取 产品皮肤名称,唯一且不为空
* @return nameList
*/
public List<String> getNameList(){
return this.nameList;
}
/**
* 设置 产品皮肤名称,唯一且不为空
* @param nameList
*/
public void setNameList(List<String> nameList){
this.nameList = nameList;
}
/**
* 获取 产品皮肤名称,唯一且不为空
* @return nameNotList
*/
public List<String> getNameNotList(){
return this.nameNotList;
}
/**
* 设置 产品皮肤名称,唯一且不为空
* @param nameNotList
*/
public void setNameNotList(List<String> nameNotList){
this.nameNotList = nameNotList;
}
/**
* 获取 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @return imageResolutionList
*/
public List<String> getImageResolutionList(){
return this.imageResolutionList;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @param imageResolutionList
*/
public void setImageResolutionList(List<String> imageResolutionList){
this.imageResolutionList = imageResolutionList;
}
/**
* 获取 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @return imageResolutionNotList
*/
public List<String> getImageResolutionNotList(){
return this.imageResolutionNotList;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @param imageResolutionNotList
*/
public void setImageResolutionNotList(List<String> imageResolutionNotList){
this.imageResolutionNotList = imageResolutionNotList;
}
/**
* 获取 预览图片
* @return previewImagePathList
*/
public List<String> getPreviewImagePathList(){
return this.previewImagePathList;
}
/**
* 设置 预览图片
* @param previewImagePathList
*/
public void setPreviewImagePathList(List<String> previewImagePathList){
this.previewImagePathList = previewImagePathList;
}
/**
* 获取 预览图片
* @return previewImagePathNotList
*/
public List<String> getPreviewImagePathNotList(){
return this.previewImagePathNotList;
}
/**
* 设置 预览图片
* @param previewImagePathNotList
*/
public void setPreviewImagePathNotList(List<String> previewImagePathNotList){
this.previewImagePathNotList = previewImagePathNotList;
}
/**
* 获取 开始 排序编号
* @return sortNumStart
*/
public Integer getSortNumStart(){
return this.sortNumStart;
}
/**
* 设置 开始 排序编号
* @param sortNumStart
*/
public void setSortNumStart(Integer sortNumStart){
this.sortNumStart = sortNumStart;
}
/**
* 获取 结束 排序编号
* @return $sortNumEnd
*/
public Integer getSortNumEnd(){
return this.sortNumEnd;
}
/**
* 设置 结束 排序编号
* @param sortNumEnd
*/
public void setSortNumEnd(Integer sortNumEnd){
this.sortNumEnd = sortNumEnd;
}
/**
* 获取 增加 排序编号
* @return sortNumIncrement
*/
public Integer getSortNumIncrement(){
return this.sortNumIncrement;
}
/**
* 设置 增加 排序编号
* @param sortNumIncrement
*/
public void setSortNumIncrement(Integer sortNumIncrement){
this.sortNumIncrement = sortNumIncrement;
}
/**
* 获取 排序编号
* @return sortNumList
*/
public List<Integer> getSortNumList(){
return this.sortNumList;
}
/**
* 设置 排序编号
* @param sortNumList
*/
public void setSortNumList(List<Integer> sortNumList){
this.sortNumList = sortNumList;
}
/**
* 获取 排序编号
* @return sortNumNotList
*/
public List<Integer> getSortNumNotList(){
return this.sortNumNotList;
}
/**
* 设置 排序编号
* @param sortNumNotList
*/
public void setSortNumNotList(List<Integer> sortNumNotList){
this.sortNumNotList = sortNumNotList;
}
/**
* 获取 开始 是否使用
* @return usedStart
*/
public Integer getUsedStart(){
return this.usedStart;
}
/**
* 设置 开始 是否使用
* @param usedStart
*/
public void setUsedStart(Integer usedStart){
this.usedStart = usedStart;
}
/**
* 获取 结束 是否使用
* @return $usedEnd
*/
public Integer getUsedEnd(){
return this.usedEnd;
}
/**
* 设置 结束 是否使用
* @param usedEnd
*/
public void setUsedEnd(Integer usedEnd){
this.usedEnd = usedEnd;
}
/**
* 获取 增加 是否使用
* @return usedIncrement
*/
public Integer getUsedIncrement(){
return this.usedIncrement;
}
/**
* 设置 增加 是否使用
* @param usedIncrement
*/
public void setUsedIncrement(Integer usedIncrement){
this.usedIncrement = usedIncrement;
}
/**
* 获取 是否使用
* @return usedList
*/
public List<Integer> getUsedList(){
return this.usedList;
}
/**
* 设置 是否使用
* @param usedList
*/
public void setUsedList(List<Integer> usedList){
this.usedList = usedList;
}
/**
* 获取 是否使用
* @return usedNotList
*/
public List<Integer> getUsedNotList(){
return this.usedNotList;
}
/**
* 设置 是否使用
* @param usedNotList
*/
public void setUsedNotList(List<Integer> usedNotList){
this.usedNotList = usedNotList;
}
/**
* 获取 开始 创建时间
* @return createTimeStart
*/
public String getCreateTimeStart(){
return this.createTimeStart;
}
/**
* 设置 开始 创建时间
* @param createTimeStart
*/
public void setCreateTimeStart(String createTimeStart){
this.createTimeStart = createTimeStart;
}
/**
* 获取 结束 创建时间
* @return createTimeEnd
*/
public String getCreateTimeEnd(){
return this.createTimeEnd;
}
/**
* 设置 结束 创建时间
* @param createTimeEnd
*/
public void setCreateTimeEnd(String createTimeEnd){
this.createTimeEnd = createTimeEnd;
}
/**
* 获取 开始 创建用户
* @return createUserIdStart
*/
public Long getCreateUserIdStart(){
return this.createUserIdStart;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public void setCreateUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
}
/**
* 获取 结束 创建用户
* @return $createUserIdEnd
*/
public Long getCreateUserIdEnd(){
return this.createUserIdEnd;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public void setCreateUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
}
/**
* 获取 增加 创建用户
* @return createUserIdIncrement
*/
public Long getCreateUserIdIncrement(){
return this.createUserIdIncrement;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public void setCreateUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
}
/**
* 获取 创建用户
* @return createUserIdList
*/
public List<Long> getCreateUserIdList(){
return this.createUserIdList;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public void setCreateUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
}
/**
* 获取 创建用户
* @return createUserIdNotList
*/
public List<Long> getCreateUserIdNotList(){
return this.createUserIdNotList;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public void setCreateUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
}
/**
* 获取 开始 修改时间
* @return updateTimeStart
*/
public String getUpdateTimeStart(){
return this.updateTimeStart;
}
/**
* 设置 开始 修改时间
* @param updateTimeStart
*/
public void setUpdateTimeStart(String updateTimeStart){
this.updateTimeStart = updateTimeStart;
}
/**
* 获取 结束 修改时间
* @return updateTimeEnd
*/
public String getUpdateTimeEnd(){
return this.updateTimeEnd;
}
/**
* 设置 结束 修改时间
* @param updateTimeEnd
*/
public void setUpdateTimeEnd(String updateTimeEnd){
this.updateTimeEnd = updateTimeEnd;
}
/**
* 设置 序号,主键,自增长
* @param id
*/
public SkinQuery id(Long id){
setId(id);
return this;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public SkinQuery idStart(Long idStart){
this.idStart = idStart;
return this;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public SkinQuery idEnd(Long idEnd){
this.idEnd = idEnd;
return this;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public SkinQuery idIncrement(Long idIncrement){
this.idIncrement = idIncrement;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public SkinQuery idList(List<Long> idList){
this.idList = idList;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public SkinQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 所属种类,来源种类
* @param categoryId
*/
public SkinQuery categoryId(Long categoryId){
setCategoryId(categoryId);
return this;
}
/**
* 设置 开始 所属种类,来源种类
* @param categoryIdStart
*/
public SkinQuery categoryIdStart(Long categoryIdStart){
this.categoryIdStart = categoryIdStart;
return this;
}
/**
* 设置 结束 所属种类,来源种类
* @param categoryIdEnd
*/
public SkinQuery categoryIdEnd(Long categoryIdEnd){
this.categoryIdEnd = categoryIdEnd;
return this;
}
/**
* 设置 增加 所属种类,来源种类
* @param categoryIdIncrement
*/
public SkinQuery categoryIdIncrement(Long categoryIdIncrement){
this.categoryIdIncrement = categoryIdIncrement;
return this;
}
/**
* 设置 所属种类,来源种类
* @param categoryIdList
*/
public SkinQuery categoryIdList(List<Long> categoryIdList){
this.categoryIdList = categoryIdList;
return this;
}
/**
* 设置 所属种类,来源种类
* @param categoryIdNotList
*/
public SkinQuery categoryIdNotList(List<Long> categoryIdNotList){
this.categoryIdNotList = categoryIdNotList;
return this;
}
/**
* 设置 产品id
* @param productId
*/
public SkinQuery productId(Long productId){
setProductId(productId);
return this;
}
/**
* 设置 开始 产品id
* @param productIdStart
*/
public SkinQuery productIdStart(Long productIdStart){
this.productIdStart = productIdStart;
return this;
}
/**
* 设置 结束 产品id
* @param productIdEnd
*/
public SkinQuery productIdEnd(Long productIdEnd){
this.productIdEnd = productIdEnd;
return this;
}
/**
* 设置 增加 产品id
* @param productIdIncrement
*/
public SkinQuery productIdIncrement(Long productIdIncrement){
this.productIdIncrement = productIdIncrement;
return this;
}
/**
* 设置 产品id
* @param productIdList
*/
public SkinQuery productIdList(List<Long> productIdList){
this.productIdList = productIdList;
return this;
}
/**
* 设置 产品id
* @param productIdNotList
*/
public SkinQuery productIdNotList(List<Long> productIdNotList){
this.productIdNotList = productIdNotList;
return this;
}
/**
* 设置 产品名称
* @param productName
*/
public SkinQuery productName(String productName){
setProductName(productName);
return this;
}
/**
* 设置 产品名称
* @param productNameList
*/
public SkinQuery productNameList(List<String> productNameList){
this.productNameList = productNameList;
return this;
}
/**
* 设置 css模板合成后文件地址
* @param cssFilePath
*/
public SkinQuery cssFilePath(String cssFilePath){
setCssFilePath(cssFilePath);
return this;
}
/**
* 设置 css模板合成后文件地址
* @param cssFilePathList
*/
public SkinQuery cssFilePathList(List<String> cssFilePathList){
this.cssFilePathList = cssFilePathList;
return this;
}
/**
* 设置 产品皮肤名称,唯一且不为空
* @param name
*/
public SkinQuery name(String name){
setName(name);
return this;
}
/**
* 设置 产品皮肤名称,唯一且不为空
* @param nameList
*/
public SkinQuery nameList(List<String> nameList){
this.nameList = nameList;
return this;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @param imageResolution
*/
public SkinQuery imageResolution(String imageResolution){
setImageResolution(imageResolution);
return this;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
* @param imageResolutionList
*/
public SkinQuery imageResolutionList(List<String> imageResolutionList){
this.imageResolutionList = imageResolutionList;
return this;
}
/**
* 设置 预览图片
* @param previewImagePath
*/
public SkinQuery previewImagePath(String previewImagePath){
setPreviewImagePath(previewImagePath);
return this;
}
/**
* 设置 预览图片
* @param previewImagePathList
*/
public SkinQuery previewImagePathList(List<String> previewImagePathList){
this.previewImagePathList = previewImagePathList;
return this;
}
/**
* 设置 排序编号
* @param sortNum
*/
public SkinQuery sortNum(Integer sortNum){
setSortNum(sortNum);
return this;
}
/**
* 设置 开始 排序编号
* @param sortNumStart
*/
public SkinQuery sortNumStart(Integer sortNumStart){
this.sortNumStart = sortNumStart;
return this;
}
/**
* 设置 结束 排序编号
* @param sortNumEnd
*/
public SkinQuery sortNumEnd(Integer sortNumEnd){
this.sortNumEnd = sortNumEnd;
return this;
}
/**
* 设置 增加 排序编号
* @param sortNumIncrement
*/
public SkinQuery sortNumIncrement(Integer sortNumIncrement){
this.sortNumIncrement = sortNumIncrement;
return this;
}
/**
* 设置 排序编号
* @param sortNumList
*/
public SkinQuery sortNumList(List<Integer> sortNumList){
this.sortNumList = sortNumList;
return this;
}
/**
* 设置 排序编号
* @param sortNumNotList
*/
public SkinQuery sortNumNotList(List<Integer> sortNumNotList){
this.sortNumNotList = sortNumNotList;
return this;
}
/**
* 设置 是否使用
* @param used
*/
public SkinQuery used(Integer used){
setUsed(used);
return this;
}
/**
* 设置 开始 是否使用
* @param usedStart
*/
public SkinQuery usedStart(Integer usedStart){
this.usedStart = usedStart;
return this;
}
/**
* 设置 结束 是否使用
* @param usedEnd
*/
public SkinQuery usedEnd(Integer usedEnd){
this.usedEnd = usedEnd;
return this;
}
/**
* 设置 增加 是否使用
* @param usedIncrement
*/
public SkinQuery usedIncrement(Integer usedIncrement){
this.usedIncrement = usedIncrement;
return this;
}
/**
* 设置 是否使用
* @param usedList
*/
public SkinQuery usedList(List<Integer> usedList){
this.usedList = usedList;
return this;
}
/**
* 设置 是否使用
* @param usedNotList
*/
public SkinQuery usedNotList(List<Integer> usedNotList){
this.usedNotList = usedNotList;
return this;
}
/**
* 设置 创建用户
* @param createUserId
*/
public SkinQuery createUserId(Long createUserId){
setCreateUserId(createUserId);
return this;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public SkinQuery createUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
return this;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public SkinQuery createUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
return this;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public SkinQuery createUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
return this;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public SkinQuery createUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
return this;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public SkinQuery createUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
*/
public List<SkinQuery> getOrConditionList(){
return this.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<SkinQuery> orConditionList){
this.orConditionList = orConditionList;
}
/**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList
*/
public List<SkinQuery> getAndConditionList(){
return this.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<SkinQuery> andConditionList){
this.andConditionList = andConditionList;
}
}
\ No newline at end of file
package com.mortals.xhx.module.skin.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
/**
* 皮肤视图对象
*
* @author zxfei
* @date 2023-04-03
*/
@Data
public class SkinVo extends BaseEntityLong {
private Long siteId;
}
\ No newline at end of file
package com.mortals.xhx.module.skin.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.skin.model.SkinEntity;
/**
* SkinService
*
* 皮肤 service接口
*
* @author zxfei
* @date 2023-04-03
*/
public interface SkinService extends ICRUDService<SkinEntity,Long>{
void syncSkin();
}
\ No newline at end of file
package com.mortals.xhx.module.skin.service.impl;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.skin.SkinBasePdu;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.feign.skin.ISkinBaseFeign;
import com.mortals.xhx.module.skin.dao.SkinDao;
import com.mortals.xhx.module.skin.model.SkinEntity;
import com.mortals.xhx.module.skin.model.SkinQuery;
import com.mortals.xhx.module.skin.service.SkinService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* SkinService
* 皮肤 service实现
*
* @author zxfei
* @date 2023-04-03
*/
@Service("skinService")
@Slf4j
public class SkinServiceImpl extends AbstractCRUDServiceImpl<SkinDao, SkinEntity, Long> implements SkinService {
@Autowired
private ISkinBaseFeign skinBaseFeign;
@Override
protected void updateBefore(SkinEntity entity, Context context) throws AppException {
super.updateBefore(entity, context);
if(YesNoEnum.YES.getValue()==entity.getUsed()){
//修改非当前皮肤都未未使用
SkinEntity skinEntity = new SkinEntity();
skinEntity.setUsed(YesNoEnum.NO.getValue());
SkinEntity condition = new SkinEntity();
condition.setUsed(YesNoEnum.YES.getValue());
this.updateBatch(skinEntity,condition,context);
}
}
@Override
public void syncSkin() {
SkinBasePdu skinBasePdu = new SkinBasePdu();
skinBasePdu.setProductCode("xxgk");
skinBasePdu.setSize(-1);
Rest<RespData<List<SkinBasePdu>>> skinBaseRest = skinBaseFeign.list(skinBasePdu);
if (skinBaseRest.getCode() == YesNoEnum.YES.getValue()) {
List<SkinBasePdu> skinBasePduList = skinBaseRest.getData().getData();
log.info("信息公开皮肤总数量:{}", skinBasePduList.size());
if (!ObjectUtils.isEmpty(skinBasePduList)) {
List<SkinEntity> newSkinList = skinBasePduList.stream().map(newSkin -> {
SkinEntity skinEntity = new SkinEntity();
skinEntity.initAttrValue();
//存相对地址
newSkin.setCssFilePath("/file"+ StrUtil.subAfter(newSkin.getCssFilePath(), "/file", false));
newSkin.setPreviewImagePath("/file"+StrUtil.subAfter(newSkin.getPreviewImagePath(), "/file", false));
BeanUtils.copyProperties(newSkin, skinEntity, BeanUtil.getNullPropertyNames(newSkin));
return skinEntity;
}).collect(Collectors.toList());
List<SkinEntity> oldSkinList = this.find(new SkinQuery());
Map<Long, SkinEntity> oldSkinMap = oldSkinList.stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
Map<Long, SkinEntity> newSkinMap = newSkinList.stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
List<SkinEntity> updateSkinLsit = newSkinList.stream().map(item -> {
if (oldSkinMap.containsKey(item.getId())) {
item.setUsed(oldSkinMap.get(item.getId()).getUsed());
item.setUpdateTime(new Date());
return item;
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
List<SkinEntity> saveSkinList = newSkinList.stream().map(item -> {
if (!oldSkinMap.containsKey(item.getId())) {
item.setCreateUserId(1L);
item.setCreateUserName("系统管理员");
item.setCreateTime(new Date());
return item;
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
//做差集
List<Long> delSkinList = oldSkinList.stream().map(item -> {
if (!newSkinMap.containsKey(item.getId())) {
return item.getId();
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(updateSkinLsit)) {
log.info("皮肤更新,size:{}", updateSkinLsit.size());
this.update(updateSkinLsit);
}
if (!ObjectUtils.isEmpty(saveSkinList)) {
log.info("皮肤新增,size:{}", saveSkinList.size());
this.save(saveSkinList);
}
if (!ObjectUtils.isEmpty(delSkinList)) {
log.info("皮肤删除,size:{}", delSkinList.size());
this.remove(delSkinList, null);
}
}
}
}
public static void main(String[] args) {
// boolean b = StrUtil.subPre("http://192.168.0.98:11078/file/fileupload/1699947376437.png", "/file");
// System.out.println(b);
String subAfter = StrUtil.subAfter("http://192.168.0.98:11078/file/fileupload/1699947376437.png", "/file", false);
System.out.println(subAfter);
}
}
\ No newline at end of file
package com.mortals.xhx.module.skin.web;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.pdu.device.DeviceMsgReqPdu;
import com.mortals.xhx.feign.device.IDeviceMessageFeign;
import com.mortals.xhx.module.skin.model.SkinEntity;
import com.mortals.xhx.module.skin.service.SkinService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 皮肤
*
* @author zxfei
* @date 2023-04-03
*/
@RestController
@RequestMapping("skin")
@Slf4j
public class SkinController extends BaseCRUDJsonBodyMappingController<SkinService, SkinEntity, Long> {
@Autowired
private ParamService paramService;
@Autowired
private IDeviceMessageFeign deviceMessageFeign;
public SkinController() {
super.setModuleDesc("皮肤");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "imageResolution", paramService.getParamBySecondOrganize("Skin", "imageResolution"));
this.addDict(model, "used", paramService.getParamBySecondOrganize("Skin", "used"));
super.init(model, context);
}
@Override
protected int saveAfter(SkinEntity entity, Map<String, Object> model, Context context) throws AppException {
//推送皮肤更新消息
DeviceMsgReqPdu deviceMsgReqPdu = new DeviceMsgReqPdu();
deviceMsgReqPdu.setSiteid(entity.getSiteId());
deviceMsgReqPdu.setProductCode("ybj");
deviceMsgReqPdu.setMessageType("edition");
deviceMsgReqPdu.setData("W10=");
deviceMsgReqPdu.setTimestamp(System.currentTimeMillis());
Rest<String> rest = deviceMessageFeign.callbackByProduct(deviceMsgReqPdu);
log.info("send device message==>{}", JSON.toJSONString(rest));
return super.saveAfter(entity, model, context);
}
@PostMapping({"refreshSkin"})
@UnAuth
public Rest<Object> refreshSkin() {
log.info("刷新皮肤");
this.service.syncSkin();
return Rest.ok("皮肤刷新操作成功");
}
}
\ 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">
<mapper namespace="com.mortals.xhx.module.skin.dao.ibatis.SkinDaoImpl">
<!-- 字段和属性映射 -->
<resultMap type="SkinEntity" id="SkinEntity-Map">
<id property="id" column="id" />
<result property="categoryId" column="categoryId" />
<result property="productId" column="productId" />
<result property="productName" column="productName" />
<result property="cssFilePath" column="cssFilePath" />
<result property="name" column="name" />
<result property="imageResolution" column="imageResolution" />
<result property="previewImagePath" column="previewImagePath" />
<result property="sortNum" column="sortNum" />
<result property="used" column="used" />
<result property="createTime" column="createTime" />
<result property="createUserId" column="createUserId" />
<result property="updateTime" column="updateTime" />
</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('categoryId') or colPickMode == 1 and data.containsKey('categoryId')))">
a.categoryId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productId') or colPickMode == 1 and data.containsKey('productId')))">
a.productId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productName') or colPickMode == 1 and data.containsKey('productName')))">
a.productName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('cssFilePath') or colPickMode == 1 and data.containsKey('cssFilePath')))">
a.cssFilePath,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('name') or colPickMode == 1 and data.containsKey('name')))">
a.name,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('imageResolution') or colPickMode == 1 and data.containsKey('imageResolution')))">
a.imageResolution,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('previewImagePath') or colPickMode == 1 and data.containsKey('previewImagePath')))">
a.previewImagePath,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sortNum') or colPickMode == 1 and data.containsKey('sortNum')))">
a.sortNum,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('used') or colPickMode == 1 and data.containsKey('used')))">
a.used,
</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('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
a.createUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="SkinEntity">
insert into mortals_sys_skin
(id,categoryId,productId,productName,cssFilePath,name,imageResolution,previewImagePath,sortNum,used,createTime,createUserId,updateTime)
VALUES
(#{id},#{categoryId},#{productId},#{productName},#{cssFilePath},#{name},#{imageResolution},#{previewImagePath},#{sortNum},#{used},#{createTime},#{createUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_sys_skin
(id,categoryId,productId,productName,cssFilePath,name,imageResolution,previewImagePath,sortNum,used,createTime,createUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.id},#{item.categoryId},#{item.productId},#{item.productName},#{item.cssFilePath},#{item.name},#{item.imageResolution},#{item.previewImagePath},#{item.sortNum},#{item.used},#{item.createTime},#{item.createUserId},#{item.updateTime})
</foreach>
</insert>
<!-- 根据ParamDto更新 -->
<update id="update" parameterType="paramDto">
update mortals_sys_skin as a
set
<trim suffixOverrides="," suffix="">
<if test="(colPickMode==0 and data.containsKey('categoryId')) or (colPickMode==1 and !data.containsKey('categoryId'))">
a.categoryId=#{data.categoryId},
</if>
<if test="(colPickMode==0 and data.containsKey('categoryIdIncrement')) or (colPickMode==1 and !data.containsKey('categoryIdIncrement'))">
a.categoryId=ifnull(a.categoryId,0) + #{data.categoryIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('productId')) or (colPickMode==1 and !data.containsKey('productId'))">
a.productId=#{data.productId},
</if>
<if test="(colPickMode==0 and data.containsKey('productIdIncrement')) or (colPickMode==1 and !data.containsKey('productIdIncrement'))">
a.productId=ifnull(a.productId,0) + #{data.productIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('productName')) or (colPickMode==1 and !data.containsKey('productName'))">
a.productName=#{data.productName},
</if>
<if test="(colPickMode==0 and data.containsKey('cssFilePath')) or (colPickMode==1 and !data.containsKey('cssFilePath'))">
a.cssFilePath=#{data.cssFilePath},
</if>
<if test="(colPickMode==0 and data.containsKey('name')) or (colPickMode==1 and !data.containsKey('name'))">
a.name=#{data.name},
</if>
<if test="(colPickMode==0 and data.containsKey('imageResolution')) or (colPickMode==1 and !data.containsKey('imageResolution'))">
a.imageResolution=#{data.imageResolution},
</if>
<if test="(colPickMode==0 and data.containsKey('previewImagePath')) or (colPickMode==1 and !data.containsKey('previewImagePath'))">
a.previewImagePath=#{data.previewImagePath},
</if>
<if test="(colPickMode==0 and data.containsKey('sortNum')) or (colPickMode==1 and !data.containsKey('sortNum'))">
a.sortNum=#{data.sortNum},
</if>
<if test="(colPickMode==0 and data.containsKey('sortNumIncrement')) or (colPickMode==1 and !data.containsKey('sortNumIncrement'))">
a.sortNum=ifnull(a.sortNum,0) + #{data.sortNumIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('used')) or (colPickMode==1 and !data.containsKey('used'))">
a.used=#{data.used},
</if>
<if test="(colPickMode==0 and data.containsKey('usedIncrement')) or (colPickMode==1 and !data.containsKey('usedIncrement'))">
a.used=ifnull(a.used,0) + #{data.usedIncrement},
</if>
<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('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
a.createUserId=#{data.createUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</update>
<!-- 批量更新 -->
<update id="updateBatch" parameterType="paramDto">
update mortals_sys_skin as a
<trim prefix="set" suffixOverrides=",">
<trim prefix="categoryId=(case" suffix="ELSE categoryId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('categoryId')) or (colPickMode==1 and !item.containsKey('categoryId'))">
when a.id=#{item.id} then #{item.categoryId}
</when>
<when test="(colPickMode==0 and item.containsKey('categoryIdIncrement')) or (colPickMode==1 and !item.containsKey('categoryIdIncrement'))">
when a.id=#{item.id} then ifnull(a.categoryId,0) + #{item.categoryIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="productId=(case" suffix="ELSE productId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('productId')) or (colPickMode==1 and !item.containsKey('productId'))">
when a.id=#{item.id} then #{item.productId}
</when>
<when test="(colPickMode==0 and item.containsKey('productIdIncrement')) or (colPickMode==1 and !item.containsKey('productIdIncrement'))">
when a.id=#{item.id} then ifnull(a.productId,0) + #{item.productIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="productName=(case" suffix="ELSE productName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('productName')) or (colPickMode==1 and !item.containsKey('productName'))">
when a.id=#{item.id} then #{item.productName}
</if>
</foreach>
</trim>
<trim prefix="cssFilePath=(case" suffix="ELSE cssFilePath end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('cssFilePath')) or (colPickMode==1 and !item.containsKey('cssFilePath'))">
when a.id=#{item.id} then #{item.cssFilePath}
</if>
</foreach>
</trim>
<trim prefix="name=(case" suffix="ELSE name end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('name')) or (colPickMode==1 and !item.containsKey('name'))">
when a.id=#{item.id} then #{item.name}
</if>
</foreach>
</trim>
<trim prefix="imageResolution=(case" suffix="ELSE imageResolution end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('imageResolution')) or (colPickMode==1 and !item.containsKey('imageResolution'))">
when a.id=#{item.id} then #{item.imageResolution}
</if>
</foreach>
</trim>
<trim prefix="previewImagePath=(case" suffix="ELSE previewImagePath end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('previewImagePath')) or (colPickMode==1 and !item.containsKey('previewImagePath'))">
when a.id=#{item.id} then #{item.previewImagePath}
</if>
</foreach>
</trim>
<trim prefix="sortNum=(case" suffix="ELSE sortNum end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('sortNum')) or (colPickMode==1 and !item.containsKey('sortNum'))">
when a.id=#{item.id} then #{item.sortNum}
</when>
<when test="(colPickMode==0 and item.containsKey('sortNumIncrement')) or (colPickMode==1 and !item.containsKey('sortNumIncrement'))">
when a.id=#{item.id} then ifnull(a.sortNum,0) + #{item.sortNumIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="used=(case" suffix="ELSE used end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('used')) or (colPickMode==1 and !item.containsKey('used'))">
when a.id=#{item.id} then #{item.used}
</when>
<when test="(colPickMode==0 and item.containsKey('usedIncrement')) or (colPickMode==1 and !item.containsKey('usedIncrement'))">
when a.id=#{item.id} then ifnull(a.used,0) + #{item.usedIncrement}
</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="createUserId=(case" suffix="ELSE createUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
when a.id=#{item.id} then #{item.createUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
when a.id=#{item.id} then #{item.updateTime}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
<!-- 根据主健查询 -->
<select id="getByKey" parameterType="paramDto" resultMap="SkinEntity-Map">
select <include refid="_columns"/>
from mortals_sys_skin as a
where a.id=#{condition.id}
</select>
<!-- 根据主健删除 -->
<delete id="deleteByKey" parameterType="paramDto">
delete a.* from mortals_sys_skin as a where a.id=#{condition.id}
</delete>
<!-- 根据主健删除一批,针对单一主健有效 -->
<delete id="deleteByKeys">
delete from mortals_sys_skin where id in
<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_sys_skin where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_sys_skin 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_sys_skin as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</delete>
<!-- 获取列表 -->
<select id="getList" parameterType="paramDto" resultMap="SkinEntity-Map">
select <include refid="_columns"/>
from mortals_sys_skin as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
<include refid="_orderCols_"/>
</select>
<!-- 获取 -->
<select id="getListCount" parameterType="paramDto" resultType="int">
select count(1)
from mortals_sys_skin as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</select>
<!-- 条件映射 -->
<sql id="_condition_">
<if test="condition != null and !condition.isEmpty()">
<!-- 条件映射-普通条件 -->
<include refid="_condition_param_">
<property name="_conditionParam_" value="condition"/>
<property name="_conditionType_" value="and"/>
</include>
<!-- 条件映射-集合之间使用AND,集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
<if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
and
<foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
<trim prefixOverrides="or" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="andCondition"/>
<property name="_conditionType_" value="or"/>
</include>
</trim>
</foreach>
</if>
<!-- 条件映射-集合之间使用OR,集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
<if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
and
<foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
<trim prefixOverrides="and" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="orCondition"/>
<property name="_conditionType_" value="and"/>
</include>
</trim>
</foreach>
</if>
</if>
</sql>
<!-- 条件映射-代参数 -->
<sql id="_condition_param_">
<bind name="conditionParamRef" value="${_conditionParam_}"/>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null">
${_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') 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('categoryId')">
<if test="conditionParamRef.categoryId != null ">
${_conditionType_} a.categoryId = #{${_conditionParam_}.categoryId}
</if>
<if test="conditionParamRef.categoryId == null">
${_conditionType_} a.categoryId is null
</if>
</if>
<if test="conditionParamRef.containsKey('categoryIdList') and conditionParamRef.categoryIdList.size() > 0">
${_conditionType_} a.categoryId in
<foreach collection="conditionParamRef.categoryIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('categoryIdNotList') and conditionParamRef.categoryIdNotList.size() > 0">
${_conditionType_} a.categoryId not in
<foreach collection="conditionParamRef.categoryIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('categoryIdStart') and conditionParamRef.categoryIdStart != null">
${_conditionType_} a.categoryId <![CDATA[ >= ]]> #{${_conditionParam_}.categoryIdStart}
</if>
<if test="conditionParamRef.containsKey('categoryIdEnd') and conditionParamRef.categoryIdEnd != null">
${_conditionType_} a.categoryId <![CDATA[ <= ]]> #{${_conditionParam_}.categoryIdEnd}
</if>
<if test="conditionParamRef.containsKey('productId')">
<if test="conditionParamRef.productId != null ">
${_conditionType_} a.productId = #{${_conditionParam_}.productId}
</if>
<if test="conditionParamRef.productId == null">
${_conditionType_} a.productId is null
</if>
</if>
<if test="conditionParamRef.containsKey('productIdList') and conditionParamRef.productIdList.size() > 0">
${_conditionType_} a.productId in
<foreach collection="conditionParamRef.productIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('productIdNotList') and conditionParamRef.productIdNotList.size() > 0">
${_conditionType_} a.productId not in
<foreach collection="conditionParamRef.productIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('productIdStart') and conditionParamRef.productIdStart != null">
${_conditionType_} a.productId <![CDATA[ >= ]]> #{${_conditionParam_}.productIdStart}
</if>
<if test="conditionParamRef.containsKey('productIdEnd') and conditionParamRef.productIdEnd != null">
${_conditionType_} a.productId <![CDATA[ <= ]]> #{${_conditionParam_}.productIdEnd}
</if>
<if test="conditionParamRef.containsKey('productName')">
<if test="conditionParamRef.productName != null and conditionParamRef.productName != ''">
${_conditionType_} a.productName like #{${_conditionParam_}.productName}
</if>
<if test="conditionParamRef.productName == null">
${_conditionType_} a.productName is null
</if>
</if>
<if test="conditionParamRef.containsKey('productNameList') and conditionParamRef.productNameList.size() > 0">
${_conditionType_} a.productName in
<foreach collection="conditionParamRef.productNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('productNameNotList') and conditionParamRef.productNameNotList.size() > 0">
${_conditionType_} a.productName not in
<foreach collection="conditionParamRef.productNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('cssFilePath')">
<if test="conditionParamRef.cssFilePath != null and conditionParamRef.cssFilePath != ''">
${_conditionType_} a.cssFilePath like #{${_conditionParam_}.cssFilePath}
</if>
<if test="conditionParamRef.cssFilePath == null">
${_conditionType_} a.cssFilePath is null
</if>
</if>
<if test="conditionParamRef.containsKey('cssFilePathList') and conditionParamRef.cssFilePathList.size() > 0">
${_conditionType_} a.cssFilePath in
<foreach collection="conditionParamRef.cssFilePathList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('cssFilePathNotList') and conditionParamRef.cssFilePathNotList.size() > 0">
${_conditionType_} a.cssFilePath not in
<foreach collection="conditionParamRef.cssFilePathNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('name')">
<if test="conditionParamRef.name != null and conditionParamRef.name != ''">
${_conditionType_} a.name like #{${_conditionParam_}.name}
</if>
<if test="conditionParamRef.name == null">
${_conditionType_} a.name is null
</if>
</if>
<if test="conditionParamRef.containsKey('nameList') and conditionParamRef.nameList.size() > 0">
${_conditionType_} a.name in
<foreach collection="conditionParamRef.nameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('nameNotList') and conditionParamRef.nameNotList.size() > 0">
${_conditionType_} a.name not in
<foreach collection="conditionParamRef.nameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('imageResolution')">
<if test="conditionParamRef.imageResolution != null and conditionParamRef.imageResolution != ''">
${_conditionType_} a.imageResolution like #{${_conditionParam_}.imageResolution}
</if>
<if test="conditionParamRef.imageResolution == null">
${_conditionType_} a.imageResolution is null
</if>
</if>
<if test="conditionParamRef.containsKey('imageResolutionList') and conditionParamRef.imageResolutionList.size() > 0">
${_conditionType_} a.imageResolution in
<foreach collection="conditionParamRef.imageResolutionList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('imageResolutionNotList') and conditionParamRef.imageResolutionNotList.size() > 0">
${_conditionType_} a.imageResolution not in
<foreach collection="conditionParamRef.imageResolutionNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('previewImagePath')">
<if test="conditionParamRef.previewImagePath != null and conditionParamRef.previewImagePath != ''">
${_conditionType_} a.previewImagePath like #{${_conditionParam_}.previewImagePath}
</if>
<if test="conditionParamRef.previewImagePath == null">
${_conditionType_} a.previewImagePath is null
</if>
</if>
<if test="conditionParamRef.containsKey('previewImagePathList') and conditionParamRef.previewImagePathList.size() > 0">
${_conditionType_} a.previewImagePath in
<foreach collection="conditionParamRef.previewImagePathList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('previewImagePathNotList') and conditionParamRef.previewImagePathNotList.size() > 0">
${_conditionType_} a.previewImagePath not in
<foreach collection="conditionParamRef.previewImagePathNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sortNum')">
<if test="conditionParamRef.sortNum != null ">
${_conditionType_} a.sortNum = #{${_conditionParam_}.sortNum}
</if>
<if test="conditionParamRef.sortNum == null">
${_conditionType_} a.sortNum is null
</if>
</if>
<if test="conditionParamRef.containsKey('sortNumList') and conditionParamRef.sortNumList.size() > 0">
${_conditionType_} a.sortNum in
<foreach collection="conditionParamRef.sortNumList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sortNumNotList') and conditionParamRef.sortNumNotList.size() > 0">
${_conditionType_} a.sortNum not in
<foreach collection="conditionParamRef.sortNumNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sortNumStart') and conditionParamRef.sortNumStart != null">
${_conditionType_} a.sortNum <![CDATA[ >= ]]> #{${_conditionParam_}.sortNumStart}
</if>
<if test="conditionParamRef.containsKey('sortNumEnd') and conditionParamRef.sortNumEnd != null">
${_conditionType_} a.sortNum <![CDATA[ <= ]]> #{${_conditionParam_}.sortNumEnd}
</if>
<if test="conditionParamRef.containsKey('used')">
<if test="conditionParamRef.used != null ">
${_conditionType_} a.used = #{${_conditionParam_}.used}
</if>
<if test="conditionParamRef.used == null">
${_conditionType_} a.used is null
</if>
</if>
<if test="conditionParamRef.containsKey('usedList') and conditionParamRef.usedList.size() > 0">
${_conditionType_} a.used in
<foreach collection="conditionParamRef.usedList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('usedNotList') and conditionParamRef.usedNotList.size() > 0">
${_conditionType_} a.used not in
<foreach collection="conditionParamRef.usedNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('usedStart') and conditionParamRef.usedStart != null">
${_conditionType_} a.used <![CDATA[ >= ]]> #{${_conditionParam_}.usedStart}
</if>
<if test="conditionParamRef.containsKey('usedEnd') and conditionParamRef.usedEnd != null">
${_conditionType_} a.used <![CDATA[ <= ]]> #{${_conditionParam_}.usedEnd}
</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>
<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('createUserId')">
<if test="conditionParamRef.createUserId != null ">
${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId}
</if>
<if test="conditionParamRef.createUserId == null">
${_conditionType_} a.createUserId is null
</if>
</if>
<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>
<if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateTime')">
<if test="conditionParamRef.updateTime != null ">
${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
</if>
<if test="conditionParamRef.updateTime == null">
${_conditionType_} a.updateTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</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}
</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('categoryId')">
a.categoryId
<if test='orderCol.categoryId != null and "DESC".equalsIgnoreCase(orderCol.categoryId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('productId')">
a.productId
<if test='orderCol.productId != null and "DESC".equalsIgnoreCase(orderCol.productId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('productName')">
a.productName
<if test='orderCol.productName != null and "DESC".equalsIgnoreCase(orderCol.productName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('cssFilePath')">
a.cssFilePath
<if test='orderCol.cssFilePath != null and "DESC".equalsIgnoreCase(orderCol.cssFilePath)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('name')">
a.name
<if test='orderCol.name != null and "DESC".equalsIgnoreCase(orderCol.name)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('imageResolution')">
a.imageResolution
<if test='orderCol.imageResolution != null and "DESC".equalsIgnoreCase(orderCol.imageResolution)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('previewImagePath')">
a.previewImagePath
<if test='orderCol.previewImagePath != null and "DESC".equalsIgnoreCase(orderCol.previewImagePath)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('sortNum')">
a.sortNum
<if test='orderCol.sortNum != null and "DESC".equalsIgnoreCase(orderCol.sortNum)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('used')">
a.used
<if test='orderCol.used != null and "DESC".equalsIgnoreCase(orderCol.used)'>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('createUserId')">
a.createUserId
<if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateTime')">
a.updateTime
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
<sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()">
GROUP BY
<trim suffixOverrides="," suffix="">
<foreach collection="groupList" open="" close="" index="index" item="item" separator=",">
${item}
</foreach>
</trim>
</if>
</sql>
</mapper>
\ No newline at end of file
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