xuhy
2026-03-27 0923c2a6f1a7b4d28e39f566f9ff27557e2bf250
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
<?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.ruoyi.system.mapper.TOldsterWarningMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TOldsterWarning">
        <id column="id" property="id" />
        <result column="oldster_id" property="oldsterId" />
        <result column="warning_time" property="warningTime" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, oldster_id, warning_time, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TOldsterWarningVO">
        select tow.id, tow.oldster_id, tow.warning_time, tow.create_time, tow.update_time, tow.create_by, tow.update_by, tow.disabled,
        t.oldster_name, t.oldster_age, t.oldster_sex, t.contact_phone, t.guardian_name, t.guardian_phone,
        t.passport_photo, t.id_card, t.birth_date, t.oldster_type, t.address
        from t_oldster_warning tow
        left join t_oldster t on tow.oldster_id = t.id
        <where>
            <if test="query.oldsterName != null and query.oldsterName != ''">
                and t.oldster_name like concat('%',#{query.oldsterName},'%')
            </if>
            <if test="query.oldsterType != null and query.oldsterType != ''">
                and t.oldster_type = #{query.oldsterType}
            </if>
            <if test="query.contactPhone != null and query.contactPhone != ''">
                and t.contact_phone like concat('%',#{query.contactPhone},'%')
            </if>
            AND tow.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        order by tow.warning_time desc
    </select>
    <select id="exportOldsterWarning" resultType="com.ruoyi.system.export.TOldsterWarningExport">
        select tow.id, tow.oldster_id, tow.warning_time, tow.create_time, tow.update_time, tow.create_by, tow.update_by, tow.disabled,
        t.oldster_name, t.oldster_age, t.oldster_sex, t.contact_phone, t.guardian_name, t.guardian_phone,
        t.passport_photo, t.id_card, t.birth_date, t.oldster_type, t.address
        from t_oldster_warning tow
        left join t_oldster t on tow.oldster_id = t.id
        <where>
            <if test="query.oldsterName != null and query.oldsterName != ''">
                and t.oldster_name like concat('%',#{query.oldsterName},'%')
            </if>
            <if test="query.oldsterType != null and query.oldsterType != ''">
                and t.oldster_type = #{query.oldsterType}
            </if>
            <if test="query.contactPhone != null and query.contactPhone != ''">
                and t.contact_phone like concat('%',#{query.contactPhone},'%')
            </if>
            AND tow.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        order by tow.warning_time desc
    </select>
 
</mapper>