zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?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" >
<!-- Table:epc_system_config_{rule}   -->
<mapper namespace="com.changhong.epc.tenant.mapper.tenant.system.SystemConfigMapper">
    
    <resultMap id="systemConfigMapperResultMap" type="com.changhong.epc.bean.tenant.system.SystemConfig">
        <result property="groupKey" column="groupKey"/><!-- 组名称 -->
        <result property="key" column="key"/><!-- key -->
        <result property="value" column="value"/><!-- 值 -->
        <result property="flag" column="flag"/>
    </resultMap>
    <sql id="systemConfigSql">
       id, `groupKey`, `ckey`, `cvalue`, ins_p, ins_t, upd_p, upd_t, data_start, flag, back
    </sql>
    
    <!-- 查询全部 -->
    <select id="selectSystem" resultType="com.changhong.epc.bean.tenant.system.SystemConfig">
        SELECT
            <include refid="systemConfigSql"/>
        FROM
            epc_system_config_{rule}
    </select>
    
    <select id="querySysConfigByGroupKey" resultType="com.changhong.epc.bean.tenant.system.SystemConfig">
           SELECT
            <include refid="systemConfigSql"/>            
        FROM
            epc_system_config_{rule}
        <where>
            <if test="groupKey != null and groupKey !=''">
                AND `groupKey`= #{groupKey}
            </if>
            <if test="cvalue != null and cvalue !=''">
                AND `cvalue` = #{cvalue}
            </if>
            <if test="ckey != null and ckey !=''">
                AND `ckey` = #{ckey}
            </if>
            AND data_start = 0;
        </where>
 
    </select>
</mapper>