13 changed files with 199 additions and 7 deletions
@ -0,0 +1,20 @@ |
|||||
|
package com.qs.serve.modules.exl.common; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/15 |
||||
|
*/ |
||||
|
public interface ExlConst { |
||||
|
|
||||
|
String TABLE_NAME_PRE = "exd_"; |
||||
|
|
||||
|
String DATE_TYPE = "date"; |
||||
|
String TYPE_INT = "int"; |
||||
|
String TYPE_MONEY = "money"; |
||||
|
String TYPE_STRING = "string"; |
||||
|
|
||||
|
String PRE_COLUMN_START = "START--"; |
||||
|
|
||||
|
String PRE_COLUMN_END = "END--"; |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.qs.serve.modules.exl.entity.dto; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/15 |
||||
|
*/ |
||||
|
@Data |
||||
|
@AllArgsConstructor |
||||
|
public class ExlConditionDto { |
||||
|
|
||||
|
String column; |
||||
|
|
||||
|
String value; |
||||
|
|
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.qs.serve.modules.exl.mapper.ExlTableConfMapper"> |
||||
|
|
||||
|
<resultMap id="exlTableConfMap" type="com.qs.serve.modules.exl.entity.ExlTableConf" > |
||||
|
<result property="id" column="id"/> |
||||
|
<result property="tableName" column="table_name"/> |
||||
|
<result property="excelTitle" column="excel_title"/> |
||||
|
<result property="enableFlag" column="enable_flag"/> |
||||
|
<result property="enableTime" column="enable_time"/> |
||||
|
<result property="remark" column="remark"/> |
||||
|
<result property="createTime" column="create_time"/> |
||||
|
<result property="updateTime" column="update_time"/> |
||||
|
<result property="tenantId" column="tenant_id"/> |
||||
|
<result property="createBy" column="create_by"/> |
||||
|
<result property="updateBy" column="update_by"/> |
||||
|
<result property="delFlag" column="del_flag"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="exlTableConfSql"> |
||||
|
exl_table_conf.`id`, |
||||
|
exl_table_conf.`table_name`, |
||||
|
exl_table_conf.`excel_title`, |
||||
|
exl_table_conf.`enable_flag`, |
||||
|
exl_table_conf.`enable_time`, |
||||
|
exl_table_conf.`remark`, |
||||
|
exl_table_conf.`create_time`, |
||||
|
exl_table_conf.`update_time`, |
||||
|
exl_table_conf.`tenant_id`, |
||||
|
exl_table_conf.`create_by`, |
||||
|
exl_table_conf.`update_by`, |
||||
|
exl_table_conf.`del_flag` </sql> |
||||
|
<select id="listData" resultType="java.util.Map"> |
||||
|
select * from ${tableName} |
||||
|
<where> |
||||
|
<if test="query.leList!=null and query.leList.size > 0"> |
||||
|
<foreach collection="query.leList" item ="item" index="i" open="(" close=")" separator=","> |
||||
|
and ${item.column} <= #{item.value} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
<if test="query.geList!=null and query.geList.size > 0"> |
||||
|
<foreach collection="query.geList" item ="item" index="i" open="(" close=")" separator=","> |
||||
|
and ${item.column} >= #{item.value} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
<if test="query.eqList!=null and query.eqList.size > 0"> |
||||
|
<foreach collection="query.eqList" item ="item" index="i" open="(" close=")" separator=","> |
||||
|
and ${item.column} = #{item.value} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
<if test="query.likeList!=null and query.likeList.size > 0"> |
||||
|
<foreach collection="query.likeList" item ="item" index="i" open="(" close=")" separator=","> |
||||
|
and ${item.column} like concat('%', #{item.value} ,'%') |
||||
|
</foreach> |
||||
|
</if> |
||||
|
</where> |
||||
|
limit #{query.startRow},#{query.pageSize} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
|
|
Loading…
Reference in new issue