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
<?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.ComActSocialMemberDao">
 
    <resultMap type="com.panzhihua.service_community.entity.ComActSocialMember" id="ComActSocialMemberBaseResultMap">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="phone" column="phone"/>
        <result property="orgId" column="org_id"/>
        <result property="position" column="position"/>
        <result property="idCard" column="id_card"/>
        <result property="account" column="account"/>
        <result property="password" column="password"/>
        <result property="status" column="status"/>
        <result property="image" column="image"/>
        <result property="createTime" column="create_time"/>
        <result property="streetId" column="street_id"/>
    </resultMap>
 
    <select id="pageList" resultType="com.panzhihua.common.model.vos.ComActSocialMemberVO">
        select t.*,t1.name as orgName, TIMESTAMPDIFF(YEAR, SUBSTRING(t.id_card, 7, 8), NOW()) AS age
        from com_act_social_member t
        left join com_act_social_org t1 on t.org_id = t1.id
        <where>
            1=1
            <if test="commonPage.keyword!=null and commonPage.keyword !=''">
                and (t.name like concat('%',#{commonPage.keyword},'%') or t.phone like concat('%',#{commonPage.keyword},'%') or t.account like concat('%',#{commonPage.keyword},'%') )
            </if>
            <if test="commonPage.status!=null ">
                and t.status = #{commonPage.status}
            </if>
            <if test="commonPage.paramId!=null ">
                and t.org_id = #{commonPage.paramId}
            </if>
            <if test="commonPage.streetId!=null ">
                and t1.street_id = #{commonPage.streetId}
            </if>
            <if test="commonPage.communityId!=null ">
                and t1.affiliated_unit_type = 2 AND t1.affiliated_unit = #{commonPage.communityId}
            </if>
        </where>
        order by t.create_time desc
    </select>
 
    <select id="detail" resultType="com.panzhihua.common.model.vos.ComActSocialMemberVO">
        select t.*,t1.name from com_act_social_member t left join com_street t1 on t.street_id = t1.street_id
        where t.id =#{id}
    </select>
    <select id="selectPbServiceTeamById"
            resultType="com.panzhihua.common.model.vos.partybuilding.ComPbServiceTeamVO">
        SELECT * FROM com_pb_service_team WHERE id = #{id}
    </select>
 
</mapper>