tj
2025-06-05 2d549a04870d1315868a7cf19952b64e8071e711
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?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.cloudroam.mapper.EmailSmtpSettingMapperCustom">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.cloudroam.model.EmailSmtpSettingDO">
        <id column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="delete_time" property="deleteTime" />
        <result column="smtp_from" property="smtpFrom" />
        <result column="smtp_host" property="smtpHost" />
        <result column="smtp_port" property="smtpPort" />
        <result column="smtp_username" property="smtpUsername" />
        <result column="smtp_password" property="smtpPassword" />
        <result column="smtp_type" property="smtpType" />
        <result column="is_enabled" property="isEnabled" />
        <result column="remark" property="remark" />
        <result column="create_user_id" property="createUserId" />
        <result column="create_user_name" property="createUserName" />
        <result column="update_user_id" property="updateUserId" />
        <result column="update_user_name" property="updateUserName" />
        <result column="is_deleted" property="isDeleted" />
        <result column="delete_user_id" property="deleteUserId" />
        <result column="delete_user_name" property="deleteUserName" />
    </resultMap>
    <select id="getEmailSmtpSettingPage" resultType="com.cloudroam.bo.EmailSmtpSettingBO">
 
        select * from (
            select e.* ,
            email_enable_flag.label as enable_flag_name,
            smtp_type.label as smtp_type_name
            from email_smtp_setting e
            left join (
            select id,label,value from sys_dict_item where dict_type='email_enable_flag' and is_deleted=0
            ) email_enable_flag
            on e.is_enabled=email_enable_flag.`value`
            left join (
            select id,label,value from sys_dict_item where dict_type='smtp_type' and is_deleted=0
            ) smtp_type
            on e.smtp_type=smtp_type.`value`
        ) t
        where t.is_deleted = 0
        <if test="smtpFrom != null and smtpFrom != ''">
            AND t.smtp_from LIKE CONCAT('%', #{smtpFrom}, '%')
        </if>
        <if test="smtpHost != null and smtpHost != ''">
            AND t.smtp_host LIKE CONCAT('%', #{smtpHost}, '%')
        </if>
        <if test="smtpPort != null ">
            AND t.smtp_port = #{smtpPort}
        </if>
        <if test="smtpUsername != null and smtpUsername != ''">
            AND t.smtp_username LIKE CONCAT('%', #{smtpUsername}, '%')
        </if>
        <if test="isEnabled != null ">
            AND t.is_enabled = #{isEnabled}
        </if>
 
        <if test="isEnabled != null ">
            AND t.is_enabled = #{isEnabled}
        </if>
        <if test="smtpType != null and smtpType != ''">
            AND t.smtp_type = #{smtpType}
        </if>
 
    </select>
 
</mapper>