Commit 7dc8b9d0 authored by 赵啸非's avatar 赵啸非

添加皮肤分辨率与预览模块

parent a1c0a436
...@@ -614,19 +614,21 @@ PRIMARY KEY (`id`) ...@@ -614,19 +614,21 @@ PRIMARY KEY (`id`)
DROP TABLE IF EXISTS `mortals_sys_skin_base`; DROP TABLE IF EXISTS `mortals_sys_skin_base`;
CREATE TABLE mortals_sys_skin_base( CREATE TABLE mortals_sys_skin_base(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长', `id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`name` varchar(256) NOT NULL COMMENT '产品皮肤名称,唯一且不为空',
`categoryId` bigint(20) COMMENT '所属种类,来源种类', `categoryId` bigint(20) COMMENT '所属种类,来源种类',
`productId` bigint(20) COMMENT '产品id', `productId` bigint(20) COMMENT '产品id',
`productName` varchar(20) NOT NULL COMMENT '产品名称', `productName` varchar(256) NOT NULL COMMENT '产品名称',
`cssFilePath` varchar(256) COMMENT 'css模板合成后文件地址', `cssFilePath` varchar(256) COMMENT 'css模板合成后文件地址',
`name` varchar(256) NOT NULL COMMENT '产品皮肤名称,唯一且不为空',
`imageResolution` varchar(256) NOT NULL COMMENT '分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)',
`previewImagePath` varchar(256) NOT NULL COMMENT '预览图片',
`sortNum` int(9) COMMENT '排序编号', `sortNum` int(9) COMMENT '排序编号',
`createTime` datetime COMMENT '创建时间', `createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户', `createUserId` bigint(20) COMMENT '创建用户',
`updateTime` datetime COMMENT '修改时间', `updateTime` datetime COMMENT '修改时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统基础皮肤'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统基础皮肤';
-- ---------------------------- -- ----------------------------
-- 系统皮肤模板表 -- 系统皮肤模板表
-- ---------------------------- -- ----------------------------
......
...@@ -9239,6 +9239,8 @@ data|object|数据对象|- ...@@ -9239,6 +9239,8 @@ data|object|数据对象|-
  productId|Long|产品id|-   productId|Long|产品id|-
  productName|String|产品名称|-   productName|String|产品名称|-
  cssFilePath|String|css模板合成后文件地址|-   cssFilePath|String|css模板合成后文件地址|-
  imageResolution|String|分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)|-
  previewImagePath|String|预览图片|-
  sortNum|Integer|排序编号|-   sortNum|Integer|排序编号|-
  skinFieldList|Arrays|皮肤属性列表|-   skinFieldList|Arrays|皮肤属性列表|-
   id|Long|ID|-    id|Long|ID|-
...@@ -9367,6 +9369,9 @@ data|object|数据对象|- ...@@ -9367,6 +9369,9 @@ data|object|数据对象|-
 productName|String|产品名称|-  productName|String|产品名称|-
 cssFilePath|String|css模板合成后文件地址|-  cssFilePath|String|css模板合成后文件地址|-
 sortNum|Integer|排序编号|-  sortNum|Integer|排序编号|-
 name|String|产品皮肤名称,唯一且不为空|-
 imageResolution|String|分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)|-
 previewImagePath|String|预览图片|-
 skinFieldList|Arrays|皮肤属性列表|-  skinFieldList|Arrays|皮肤属性列表|-
  id|Long|ID|-   id|Long|ID|-
  skinId|Long|皮肤id|-   skinId|Long|皮肤id|-
...@@ -9424,6 +9429,8 @@ productName|String|产品名称|是|- ...@@ -9424,6 +9429,8 @@ productName|String|产品名称|是|-
cssFilePath|String|css模板合成后文件地址|是|- cssFilePath|String|css模板合成后文件地址|是|-
sortNum|Integer|排序编号|是|- sortNum|Integer|排序编号|是|-
name|String|产品皮肤名称,唯一且不为空|是|- name|String|产品皮肤名称,唯一且不为空|是|-
imageResolution|String|分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)|是|-
previewImagePath|String|预览图片|是|-
skinFieldList|Arrays|皮肤属性列表|是|- skinFieldList|Arrays|皮肤属性列表|是|-
 id|Long|ID|是|-  id|Long|ID|是|-
 skinId|Long|皮肤id|是|-  skinId|Long|皮肤id|是|-
......
...@@ -118,6 +118,12 @@ ...@@ -118,6 +118,12 @@
<artifactId>jjwt</artifactId> <artifactId>jjwt</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>RELEASE</version>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
......
package com.mortals.xhx.base.framework.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
/**
* @author: zxfei
* @date: 2021/10/11 15:20
* @description:
**/
@Configuration
public class FreemarkerApplicationConfig {
@Bean(name = "freeMarkerConfigurer")
public FreeMarkerConfigurer freeMarkerConfigurer() {
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
configurer.setDefaultEncoding("UTF-8");
configurer.setTemplateLoaderPath("classpath:/template");
return configurer;
}
}
package com.mortals.xhx.common.utils;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.code.YesNo;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.framework.config.FreemarkerApplicationConfig;
import com.mortals.xhx.common.key.GenConstants;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;
import lombok.SneakyThrows;
import org.springframework.util.ObjectUtils;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import java.util.stream.Collectors;
public class FreeMarkerUtils {
/**
* 项目空间路径
*/
private static final String PROJECT_PATH = "main/java";
private static final String TEST_PATH = "test/java/com/mortals/httpclient";
/**
* mybatis空间路径
*/
private static final String MYBATIS_PATH = "main/resources/sqlmap";
/**
* 默认上级菜单,系统工具
*/
private static final String DEFAULT_PARENT_MENU_ID = "3";
public static Configuration cfg = null;
public static StringBuilder dbSql = new StringBuilder();
public static StringBuilder menuSql = new StringBuilder();
public static StringBuilder paramsSql = new StringBuilder();
public static StringBuilder apimd = new StringBuilder();
public static StringBuilder apitwomd = new StringBuilder();
public static StringBuilder apidict = new StringBuilder();
/**
* 初始化freeMaker方法
*/
@SneakyThrows
public static void initFreeMarker(String path) {
//初始化模板引擎
cfg = new Configuration(Configuration.VERSION_2_3_29);
cfg.setClassForTemplateLoading(FreemarkerApplicationConfig.class, "/template/" + path);
//cfg.setClassForTemplateLoading(FreemarkerApplicationConfig.class,"/template/sql");
//指定模板文件存放的地方
//cfg.setDirectoryForTemplateLoading(new File(System.getProperty("user.dir") + "\\government-manager\\target\\classes\\template\\java"));
//cfg.setDirectoryForTemplateLoading(new File(System.getProperty("user.dir") + "\\government-manager\\target\\classes\\template\\xml\\"));
//cfg.set
// cfg.setTemplateLoader(new ClassTemplateLoader(FreeMarkerUtils.class,"/template/java/entity.ftl"));
// cfg.setClassForTemplateLoading(FreeMarkerUtils.class, "/template/");
// cfg.setClassForTemplateLoading(FreeMarkerUtils.class, "\\template\\sql");
//cfg.setClassForTemplateLoading(FreeMarkerUtils.class, "\\template\\vue");
//cfg.setClassForTemplateLoading(FreeMarkerUtils.class, "\\template\\xml");
//设置字符编码集
cfg.setDefaultEncoding("UTF-8");
//设置异常的处理方式
cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
//设置输出时间格式
cfg.setDateFormat("yyyy-MM-dd HH:mm:ss");
}
/**
* 初始化freeMaker方法
*/
@SneakyThrows
public static void initFreeMarkerPath(String templatePath) {
//初始化模板引擎
cfg = new Configuration(Configuration.VERSION_2_3_29);
cfg.setDirectoryForTemplateLoading(new File(templatePath));
//设置字符编码集
cfg.setDefaultEncoding("UTF-8");
//设置异常的处理方式
cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
//设置输出时间格式
cfg.setDateFormat("yyyy-MM-dd HH:mm:ss");
}
/**
* 获取模板信息
*
* @return 模板列表
*/
public static List<String> getTemplateList(String tplCategory) {
List<String> templates = new ArrayList<String>();
templates.add("vo.java.ftl");
templates.add("enum.java.ftl");
templates.add("entity.java.ftl");
templates.add("entityQuery.java.ftl");
templates.add("dao.java.ftl");
templates.add("daoImpl.java.ftl");
// templates.add("web.java.ftl");
templates.add("webBody.java.ftl");
templates.add("webForm.java.ftl");
templates.add("sqlMap.xml.ftl");
templates.add("db.sql.ftl");
templates.add("menu.sql.ftl");
templates.add("params.sql.ftl");
templates.add("api.md.ftl");
templates.add("api-two.md.ftl");
templates.add("apidict.md.ftl");
templates.add("httpclient.test.ftl");
if (GenConstants.TPL_CRUD.equals(tplCategory)) {
templates.add("service.java.ftl");
templates.add("serviceImpl.java.ftl");
templates.add("webVueList.vue.ftl");
templates.add("VueDialogShow.vue.ftl");
// templates.add("webVueShow.vue.ftl");
} else if (GenConstants.TPL_TREE.equals(tplCategory)) {
templates.add("entity-tree.java.ftl");
templates.add("service-tree.java.ftl");
templates.add("serviceImpl-tree.java.ftl");
templates.add("VueTreeDialogShow.vue.ftl");
templates.add("webVueTreeList.vue.ftl");
} else if (GenConstants.TPL_SUB.equals(tplCategory) || GenConstants.TPL_SUB_ONE.equals(tplCategory)) {
templates.add("service.java.ftl");
templates.add("serviceImpl.java.ftl");
templates.add("webVueList.vue.ftl");
//templates.add("webVueShow.vue.ftl");
templates.add("VueDialogShow.vue.ftl");
}
//templates.add("webVueView.vue.ftl");
return templates;
}
/**
* 获取model模板信息
*
* @return 模板列表
*/
public static Set<String> getModelTemplateSet() {
Set<String> templates = new HashSet<String>();
templates.add("vo.java.ftl");
templates.add("entity.java.ftl");
templates.add("entityQuery.java.ftl");
templates.add("sqlMap.xml.ftl");
templates.add("entity-tree.java.ftl");
return templates;
}
// 获取模板对象
public static Template getTemplate(String templateName) {
try {
return cfg.getTemplate(templateName);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 提供模板文件,输出到控制台
*
* @param templateName 模板对象
* @param dataModel 数据模型
*/
public static void printConsole(String templateName, Map dataModel) {
Template template = getTemplate(templateName);
try {
template.process(dataModel, new PrintWriter(System.out));
} catch (TemplateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 提供模板文件名称,输出到文件中
*
* @param templateName 模板对象
* @param dataModel 数据模型
* @param destFile 目标文件地址
*/
public static String printFile(String templateName, Map dataModel, String destFile) {
System.out.println(destFile);
Template template = getTemplate(templateName);
try {
template.process(dataModel, new FileWriter(new File(destFile)));
} catch (TemplateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return destFile;
}
public static String printFile(String templateName, List<Map> dataModel, String destFile) {
Template template = getTemplate(templateName);
try {
template.process(dataModel, new FileWriter(new File(destFile)));
} catch (TemplateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return destFile;
}
public static void main(String[] args) {
}
}
...@@ -10,7 +10,7 @@ import com.mortals.xhx.module.skin.model.vo.SkinBaseVo; ...@@ -10,7 +10,7 @@ import com.mortals.xhx.module.skin.model.vo.SkinBaseVo;
* 系统基础皮肤实体对象 * 系统基础皮肤实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-05-24 * @date 2022-05-27
*/ */
public class SkinBaseEntity extends SkinBaseVo { public class SkinBaseEntity extends SkinBaseVo {
...@@ -41,6 +41,16 @@ public class SkinBaseEntity extends SkinBaseVo { ...@@ -41,6 +41,16 @@ public class SkinBaseEntity extends SkinBaseVo {
* 产品皮肤名称,唯一且不为空 * 产品皮肤名称,唯一且不为空
*/ */
private String name; private String name;
/**
* 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*/
@Excel(name = "分辨率 ", readConverterExp = "1=1920*1080,2=1080*1920,3=1280*1280")
private String imageResolution;
/**
* 预览图片
*/
@Excel(name = "预览图片")
private String previewImagePath;
...@@ -129,6 +139,34 @@ public class SkinBaseEntity extends SkinBaseVo { ...@@ -129,6 +139,34 @@ public class SkinBaseEntity extends SkinBaseVo {
public void setName(String name){ public void setName(String name){
this.name = 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;
}
...@@ -157,6 +195,8 @@ public class SkinBaseEntity extends SkinBaseVo { ...@@ -157,6 +195,8 @@ public class SkinBaseEntity extends SkinBaseVo {
sb.append(",cssFilePath:").append(getCssFilePath()); sb.append(",cssFilePath:").append(getCssFilePath());
sb.append(",sortNum:").append(getSortNum()); sb.append(",sortNum:").append(getSortNum());
sb.append(",name:").append(getName()); sb.append(",name:").append(getName());
sb.append(",imageResolution:").append(getImageResolution());
sb.append(",previewImagePath:").append(getPreviewImagePath());
return sb.toString(); return sb.toString();
} }
...@@ -170,8 +210,12 @@ public class SkinBaseEntity extends SkinBaseVo { ...@@ -170,8 +210,12 @@ public class SkinBaseEntity extends SkinBaseVo {
this.cssFilePath = ""; this.cssFilePath = "";
this.sortNum = 0; this.sortNum = null;
this.name = ""; this.name = "";
this.imageResolution = "1";
this.previewImagePath = "";
} }
} }
\ No newline at end of file
...@@ -3,16 +3,29 @@ package com.mortals.xhx.module.skin.service.impl; ...@@ -3,16 +3,29 @@ package com.mortals.xhx.module.skin.service.impl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.utils.FreeMarkerUtils;
import com.mortals.xhx.module.skin.model.*; import com.mortals.xhx.module.skin.model.*;
import com.mortals.xhx.module.skin.service.SkinFieldService; import com.mortals.xhx.module.skin.service.SkinFieldService;
import freemarker.template.Template;
import org.apache.http.entity.ContentType;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.skin.dao.SkinBaseDao; import com.mortals.xhx.module.skin.dao.SkinBaseDao;
import com.mortals.xhx.module.skin.service.SkinBaseService; import com.mortals.xhx.module.skin.service.SkinBaseService;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* SkinBaseService * SkinBaseService
...@@ -26,13 +39,15 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -26,13 +39,15 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
@Autowired @Autowired
private SkinFieldService skinFieldService; private SkinFieldService skinFieldService;
@Autowired
private UploadService uploadService;
@Override @Override
protected void validData(SkinBaseEntity entity, Context context) throws AppException { protected void validData(SkinBaseEntity entity, Context context) throws AppException {
SkinBaseQuery skinBaseQuery = new SkinBaseQuery(); SkinBaseQuery skinBaseQuery = new SkinBaseQuery();
skinBaseQuery.setName(entity.getName()); skinBaseQuery.setName(entity.getName());
SkinBaseEntity skinBaseEntity = this.selectOne(skinBaseQuery); SkinBaseEntity skinBaseEntity = this.selectOne(skinBaseQuery);
if(!ObjectUtils.isEmpty(skinBaseEntity)&&entity.newEntity()){ if (!ObjectUtils.isEmpty(skinBaseEntity) && entity.newEntity()) {
throw new AppException("皮肤名称已存在"); throw new AppException("皮肤名称已存在");
} }
super.validData(entity, context); super.validData(entity, context);
...@@ -67,23 +82,47 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -67,23 +82,47 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
skinFieldService.remove(ids, context); skinFieldService.remove(ids, context);
} }
if (!ObjectUtils.isEmpty(entity.getSkinFieldList())) { if (!ObjectUtils.isEmpty(entity.getSkinFieldList())) {
entity.getSkinFieldList().stream().forEach(item->{ entity.getSkinFieldList().stream().forEach(item -> {
item.setSkinId(entity.getId()); item.setSkinId(entity.getId());
}); });
skinFieldService.save(entity.getSkinFieldList(), context); skinFieldService.save(entity.getSkinFieldList(), context);
} }
} }
@Override
protected void updateBefore(SkinBaseEntity entity, Context context) throws AppException {
genTemplateCss(entity, context);
super.updateBefore(entity, context);
}
@Override @Override
protected void saveBefore(SkinBaseEntity entity, Context context) throws AppException { protected void saveBefore(SkinBaseEntity entity, Context context) throws AppException {
//todo 合成实现css模板文件 //todo 合成实现css模板文件
genTemplateCss(entity, context);
super.saveBefore(entity, context); super.saveBefore(entity, context);
} }
private void genTemplateCss(SkinBaseEntity entity, Context context) { private void genTemplateCss(SkinBaseEntity entity, Context context) {
//加载模板,合成模板数据 //加载模板,合成模板数据
//更新时候删除 Map data = new HashMap();
data.put("columns", entity.getSkinFieldList());
String temp = "skin.css.ftl";
try {
FreeMarkerUtils.initFreeMarker(temp);
StringWriter sw = new StringWriter();
Template template = FreeMarkerUtils.getTemplate(temp);
template.process(data, sw);
InputStream inputStream = new ByteArrayInputStream(sw.toString().getBytes(Constant.UTF8));
MultipartFile file = new MockMultipartFile("file.css", "file.css", ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream);
String filePath = uploadService.saveFileUpload(file, "/file/uploadfile/", context.getUser());
entity.setCssFilePath(filePath);
} catch (Exception e) {
log.error("css失败:", e);
}
} }
} }
\ No newline at end of file
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
<result property="createUserId" column="createUserId" /> <result property="createUserId" column="createUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="name" column="name" /> <result property="name" column="name" />
<result property="imageResolution" column="imageResolution" />
<result property="previewImagePath" column="previewImagePath" />
</resultMap> </resultMap>
...@@ -52,23 +54,29 @@ ...@@ -52,23 +54,29 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('name') or colPickMode == 1 and data.containsKey('name')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('name') or colPickMode == 1 and data.containsKey('name')))">
a.name, a.name,
</if> </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>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="SkinBaseEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="SkinBaseEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_sys_skin_base insert into mortals_sys_skin_base
(categoryId,productId,productName,cssFilePath,sortNum,createTime,createUserId,updateTime,name) (categoryId,productId,productName,cssFilePath,sortNum,createTime,createUserId,updateTime,name,imageResolution,previewImagePath)
VALUES VALUES
(#{categoryId},#{productId},#{productName},#{cssFilePath},#{sortNum},#{createTime},#{createUserId},#{updateTime},#{name}) (#{categoryId},#{productId},#{productName},#{cssFilePath},#{sortNum},#{createTime},#{createUserId},#{updateTime},#{name},#{imageResolution},#{previewImagePath})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_sys_skin_base insert into mortals_sys_skin_base
(categoryId,productId,productName,cssFilePath,sortNum,createTime,createUserId,updateTime,name) (categoryId,productId,productName,cssFilePath,sortNum,createTime,createUserId,updateTime,name,imageResolution,previewImagePath)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.categoryId},#{item.productId},#{item.productName},#{item.cssFilePath},#{item.sortNum},#{item.createTime},#{item.createUserId},#{item.updateTime},#{item.name}) (#{item.categoryId},#{item.productId},#{item.productName},#{item.cssFilePath},#{item.sortNum},#{item.createTime},#{item.createUserId},#{item.updateTime},#{item.name},#{item.imageResolution},#{item.previewImagePath})
</foreach> </foreach>
</insert> </insert>
...@@ -117,6 +125,12 @@ ...@@ -117,6 +125,12 @@
<if test="(colPickMode==0 and data.containsKey('name')) or (colPickMode==1 and !data.containsKey('name'))"> <if test="(colPickMode==0 and data.containsKey('name')) or (colPickMode==1 and !data.containsKey('name'))">
a.name=#{data.name}, a.name=#{data.name},
</if> </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>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -212,6 +226,20 @@ ...@@ -212,6 +226,20 @@
</if> </if>
</foreach> </foreach>
</trim> </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> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -493,6 +521,36 @@ ...@@ -493,6 +521,36 @@
#{item} #{item}
</foreach> </foreach>
</if> </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')">
${_conditionType_} a.imageResolution in
<foreach collection="conditionParamRef.imageResolutionList" 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')">
${_conditionType_} a.previewImagePath in
<foreach collection="conditionParamRef.previewImagePathList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -556,6 +614,16 @@ ...@@ -556,6 +614,16 @@
<if test='orderCol.name != null and "DESC".equalsIgnoreCase(orderCol.name)'>DESC</if> <if test='orderCol.name != null and "DESC".equalsIgnoreCase(orderCol.name)'>DESC</if>
, ,
</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>
</trim> </trim>
</if> </if>
</sql> </sql>
......
/* 变量 */ /* 变量 */
:root { :root {
/* 标题颜色 */ <#list columns as column>
--main-h1-color: ${skin.titleColorStyle}; <#if column.fieldType == 1>
/* 时间颜色 */ /* ${column.fieldName} */
--main-time-color: ${skin.timeColorStyle}; --main-${column.fieldCode}-color: ${column.fieldValue};
/* 数据颜色 */ </#if>
--main-info-color: ${skin.dataTitleColorStyle}; </#list>
/* 备案颜色 */
} }
/* 背景颜色 */ <#list columns as column>
.main-bg-img{ <#if column.fieldType == 2>
background: url(${skin.backgroundImagePath}) no-repeat; /* ${column.fieldName} */
.main-${column.fieldCode}-img{
background: url(${column.fieldValue}) no-repeat;
} }
/* 现场取号 */ </#if>
.main-xc-img{ </#list>
background: url(${skin.backgroundImagePath}) no-repeat;
}
/* 预约取号 */
.main-yy-img{
background: url(${skin.backgroundImagePath}) no-repeat;
}
/* vip取号 */
.main-big-img{
background: url(${skin.backgroundImagePath}) no-repeat;
}
/* 重打小票 */
.main-cd-img{
background: url(${skin.backgroundImagePath}) no-repeat;
}
/* 现场签到 */
.main-qd-img{
background: url(${skin.backgroundImagePath}) no-repeat;
}
/* 政务网取号 */
.main-zwfw-img{
background: url(${skin.backgroundImagePath}) no-repeat;
}
\ 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