You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.8 KiB

2 years ago
<?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>
<sql id="exlBaseWhere">
2 years ago
<where>
<if test="query.leList!=null and query.leList.size > 0">
2 years ago
and
<foreach collection="query.leList" item ="item" index="i" separator="and">
${item.column} &lt;= #{item.value}
2 years ago
</foreach>
</if>
<if test="query.geList!=null and query.geList.size > 0">
2 years ago
and
<foreach collection="query.geList" item ="item" index="i" separator="and">
${item.column} &gt;= #{item.value}
2 years ago
</foreach>
</if>
<if test="query.eqList!=null and query.eqList.size > 0">
2 years ago
and
<foreach collection="query.eqList" item ="item" index="i" separator="and">
${item.column} = #{item.value}
2 years ago
</foreach>
</if>
<if test="query.likeList!=null and query.likeList.size > 0">
2 years ago
and
<foreach collection="query.likeList" item ="item" index="i" separator="and">
<if test="item.value!=null and item.value != ''">
${item.column} like concat('%', #{item.value} ,'%')
</if>
<if test="item.value==null or item.value == ''">
1=1
</if>
2 years ago
</foreach>
</if>
<if test="query.inBizList!=null and query.inBizList.size > 0">
and
<foreach collection="query.inBizList" item ="inItem" index="i" separator="and">
${inItem.column} in (
<foreach collection="inItem.values" item="item" index="i" separator=",">
#{item}
</foreach>
)
</foreach>
</if>
2 years ago
</where>
</sql>
<select id="listData" resultType="java.util.Map">
select * from ${tableName}
<include refid="exlBaseWhere"></include>
2 years ago
</select>
<select id="countData" resultType="java.lang.Long">
select count(*) from ${tableName}
<include refid="exlBaseWhere"></include>
</select>
<select id="pageData" resultType="java.util.Map">
select * from ${tableName}
<include refid="exlBaseWhere"></include>
limit #{query.startRow},#{query.pageSize}
</select>
2 years ago
</mapper>