mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
<?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.panzhihua.service_community.dao.ComActReserveDangerAreaDao">
 
    <resultMap type="com.panzhihua.service_community.entity.ComActReserveDangerArea"
               id="ComActReserveDangerAreaBaseResultMap">
        <result property="id" column="id"/>
        <result property="type" column="type"/>
        <result property="areaName" column="area_name"/>
        <result property="county" column="county"/>
        <result property="province" column="province"/>
        <result property="city" column="city"/>
        <result property="createTime" column="create_time"/>
        <result property="screenTime" column="screen_time"/>
    </resultMap>
 
    <select id="pageList" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveDangerAreaVO">
        select * from com_act_reserve_danger_area
        <where>
            status = 1
            <if test="commonPage.type !=null">
                <if test="commonPage.type == 0">
                    and screen_time is null
                </if>
                <if test="commonPage.type == 1">
                    and screen_time is not null
                </if>
            </if>
            <if test="commonPage.address !=null and commonPage.address !=''">
                and (area_name like concat('%',#{commonPage.address},'%') or country like concat('%',#{commonPage.address},'%') or province like concat('%',#{commonPage.address},'%') or city like concat('%',#{commonPage.address},'%'))
            </if>
        </where>
    </select>
 
    <select id="statics" resultType="com.panzhihua.common.model.vos.community.reserve.DangerAreaStatics">
        select (select count(*) from com_act_reserve_danger_area where status = 1 and type = 1) middleCount,(select count(*) from com_act_reserve_danger_area where status = 1 and type = 2) highCount
    </select>
</mapper>