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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?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_jinhui_community.dao.JinhuiComActWorkGuideDAO">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="itemMap" type="com.panzhihua.service_jinhui_community.entity.JinhuiComActWorkGuide">
        <id column="id" property="id" />
        <result column="title" property="title" />
        <result column="content" property="content" />
        <result column="classify" property="classify" />
        <result column="time_at" property="timeAt" />
        <result column="address" property="address" />
        <result column="phone" property="phone" />
        <result column="lon" property="lon" />
        <result column="lat" property="lat" />
        <result column="create_at" property="createAt" />
        <result column="create_by" property="createBy" />
        <result column="update_at" property="updateAt" />
        <result column="update_by" property="updateBy" />
        <result column="community_id" property="communityId" />
        <result column="area_code" property="areaCode" />
        <result column="json_object" property="jsonObject" />
        <result column="is_on_line" property="isOnLine" />
    </resultMap>
 
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, title, content, classify, time_at, address, phone, lon, lat, create_at, create_by,
        update_at, update_by,community_id,is_on_line
    </sql>
 
 
    <!-- 分页查询 -->
    <select id="pageWorkGuide" resultType="com.panzhihua.common.model.vos.community.ComActWorkGuideVO">
        select
            id,
            title,
            content,
            classify,
            time_at,
            address,
            phone,
            create_at,
            json_object,
            community_id,
            is_on_line
        from jinhui_com_act_work_guide
        <where>
            <if test='pageActWorkGuideDTO.classify != null'>
                and classify = #{pageActWorkGuideDTO.classify}
            </if>
            <if test='pageActWorkGuideDTO.areaCode != null'>
                and area_code = #{pageActWorkGuideDTO.areaCode}
            </if>
            <if test='pageActWorkGuideDTO.title != null and pageActWorkGuideDTO.title.trim() != &quot;&quot;'>
                and title like concat('%',#{pageActWorkGuideDTO.title},'%')
            </if>
            <if test='pageActWorkGuideDTO.isOnLine != null and pageActWorkGuideDTO.isOnLine != &quot;&quot;'>
                and is_on_line=#{pageActWorkGuideDTO.isOnLine}
            </if>
        </where>
        order by update_at desc
    </select>
 
    <select id="getWorkGuideListByClassifyId" resultType="com.panzhihua.common.model.vos.community.ComActWorkGuideDetailAppletsVO">
        select
            id,
            title,
            content,
            classify,
            time_at,
            address,
            phone,
            create_at,
            json_object,
            is_on_line,
            community_id
        from jinhui_com_act_work_guide
        <where>
            1=1
            <if test="classifyId != null and classifyId!='' ">
                and classify = #{classifyId}
            </if>
            <if test='isOnLine != null and isOnLine != &quot;&quot;'>
                and is_on_line=#{isOnLine}
            </if>
        </where>
        order by create_at desc
        <if test="pageSize != null">
            limit ${pageSize}
        </if>
    </select>
 
 
    <delete id="deleteQuesSubAll">
        delete from jinhui_com_act_questnaire_sub where que_id = #{queId}
    </delete>
 
    <delete id="deleteQuesSubAll2">
        delete from jinhui_com_act_questnaire_sub_selection where que_id = #{queId}
    </delete>
 
 
</mapper>