linwe
2024-08-09 8b7258c9427882bb1798f1502eaa35184c6e374e
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
70
71
72
73
74
75
76
<?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="org.springblade.modules.smsTask.mapper.SmsTaskMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="smsTaskResultMap" type="org.springblade.modules.smsTask.entity.SmsTaskEntity">
    </resultMap>
 
 
    <select id="selectSmsTaskPage" resultMap="smsTaskResultMap">
        <include refid="selectSmsTask"/>
        <where>
            <if test="smsTask.id != null "> and id = #{smsTask.id}</if>
            <if test="smsTask.name != null  and smsTask.name != ''"> and name = #{smsTask.name}</if>
            <if test="smsTask.community != null  and smsTask.community != ''"> and community = #{smsTask.community}</if>
            <if test="smsTask.createTime != null "> and create_time = #{smsTask.createTime}</if>
            <if test="smsTask.updateTime != null "> and update_time = #{smsTask.updateTime}</if>
            <if test="smsTask.smsTemplate != null "> and sms_template = #{smsTask.smsTemplate}</if>
            <if test="smsTask.deleteFlag != null  and smsTask.deleteFlag != ''"> and delete_flag = #{smsTask.deleteFlag}</if>
            <if test="smsTask.aoiCode != null  and smsTask.aoiCode != ''"> and district_id = #{smsTask.aoiCode}</if>
            <if test="smsTask.buildingCode != null  smsTask.and buildingCode != ''"> and building_code = #{smsTask.buildingCode}</if>
        </where>
    </select>
 
    <resultMap type="org.springblade.modules.smsTask.dto.SmsTaskDTO" id="SmsTaskDTOResult">
        <result property="id"    column="id"    />
        <result property="name"    column="name"    />
        <result property="community"    column="community"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="smsTemplate"    column="sms_template"    />
        <result property="deleteFlag"    column="delete_flag"    />
        <result property="districtId"    column="district_id"    />
        <result property="buildingCode"    column="building_code"    />
    </resultMap>
 
    <sql id="selectSmsTask">
        select
            id,
            name,
            community,
            create_time,
            update_time,
            sms_template,
            delete_flag,
            district_id,
            building_code,
            building_name,
            district_name
        from
            jczz_sms_task
    </sql>
 
    <select id="selectSmsTaskById" parameterType="long" resultMap="SmsTaskDTOResult">
        <include refid="selectSmsTask"/>
        where
        id = #{id}
    </select>
 
    <select id="selectSmsTaskList" parameterType="org.springblade.modules.smsTask.dto.SmsTaskDTO" resultMap="SmsTaskDTOResult">
        <include refid="selectSmsTask"/>
        <where>
            <if test="id != null "> and id = #{id}</if>
            <if test="name != null  and name != ''"> and name = #{name}</if>
            <if test="community != null  and community != ''"> and community = #{community}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
            <if test="updateTime != null "> and update_time = #{updateTime}</if>
            <if test="smsTemplate != null "> and sms_template = #{smsTemplate}</if>
            <if test="deleteFlag != null  and deleteFlag != ''"> and delete_flag = #{deleteFlag}</if>
            <if test="districtId != null  and districtId != ''"> and district_id = #{districtId}</if>
            <if test="buildingCode != null  and buildingCode != ''"> and building_code = #{buildingCode}</if>
        </where>
    </select>
 
 
</mapper>