<?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.sangeshenbian.dao.PartyMemberMapper">
|
|
<select id="pageList" resultType="com.panzhihua.sangeshenbian.model.entity.PartyMember">
|
select id,
|
name,
|
gender,
|
phone,
|
districts,
|
districts_code,
|
id_number,
|
street,
|
street_id,
|
community,
|
community_id,
|
service_target,
|
party_organization,
|
avatar,
|
audit_status,
|
freeze_status,
|
refuse_reason,
|
create_time,
|
update_time,
|
create_by,
|
update_by,
|
del_flag
|
from sgsb_party_member
|
<where>
|
del_flag = 0
|
<if test="query.auditStatus !=null">
|
and audit_status = #{query.auditStatus}
|
</if>
|
<if test="loginUserInfo.accountLevel==2">
|
and districts_code = #{loginUserInfo.districtsCode}
|
</if>
|
<if test="loginUserInfo.accountLevel==3">
|
and street_id = #{loginUserInfo.streetId}
|
</if>
|
<if test="loginUserInfo.accountLevel==4">
|
and community_id = #{loginUserInfo.communityId}
|
</if>
|
<if test="query.name != null and query.name != ''">
|
and name like concat('%',#{query.name},'%')
|
</if>
|
<if test="query.communityId != null and query.communityId != ''">
|
and community_id = #{query.communityId}
|
</if>
|
<if test="query.serviceTarget != null and query.serviceTarget != ''">
|
and service_target like concat('%',#{query.serviceTarget},'%')
|
</if>
|
<if test="query.partyOrganization != null and query.partyOrganization != ''">
|
and party_organization like concat('%',#{query.partyOrganization},'%')
|
</if>
|
<if test="query.freezeStatus != null and query.freezeStatus != ''">
|
and freeze_status = #{query.freezeStatus}
|
</if>
|
<if test="query.idNumber != null and query.idNumber != ''">
|
and id_number = #{query.idNumber}
|
</if>
|
</where>
|
<if test="query.createTimeSort != null and query.createTimeSort==1 ">
|
order by create_time desc
|
</if>
|
<if test="query.createTimeSort != null and query.createTimeSort==2 ">
|
order by create_time asc
|
</if>
|
<if test="query.createTimeSort ==null and query.updateTimeSort != null and query.updateTimeSort == 1">
|
order by update_time desc
|
</if>
|
<if test="query.createTimeSort ==null and query.updateTimeSort != null and query.updateTimeSort == 2">
|
order by update_time asc
|
</if>
|
<if test="query.createTimeSort ==null and query.updateTimeSort == null ">
|
order by create_time desc
|
</if>
|
|
</select>
|
<select id="queryList" resultType="com.panzhihua.sangeshenbian.model.entity.PartyMember">
|
select id,
|
name,
|
gender,
|
phone,
|
districts,
|
districts_code,
|
street,
|
street_id,
|
CONCAT(districts,"-",street,"-",community) AS community,
|
community_id,
|
service_target,
|
party_organization,
|
avatar,
|
audit_status,
|
freeze_status,
|
refuse_reason,
|
create_time,
|
update_time,
|
create_by,
|
update_by,
|
del_flag
|
from sgsb_party_member
|
<where>
|
del_flag = 0
|
<if test="loginUserInfo.accountLevel==2">
|
and districts_code = #{loginUserInfo.districtsCode}
|
</if>
|
<if test="loginUserInfo.accountLevel==3">
|
and street_id = #{loginUserInfo.streetId}
|
</if>
|
<if test="loginUserInfo.accountLevel==4">
|
and street_id = #{loginUserInfo.streetId}
|
</if>
|
<if test="query.name != null and query.name != ''">
|
and name like concat('%',#{query.name},'%')
|
</if>
|
<if test="query.communityId != null and query.communityId != ''">
|
and community_id = #{query.communityId}
|
</if>
|
<if test="query.serviceTarget != null and query.serviceTarget != ''">
|
and service_target like concat('%',#{query.serviceTarget},'%')
|
</if>
|
<if test="query.partyOrganization != null and query.partyOrganization != ''">
|
and party_organization like concat('%',#{query.partyOrganization},'%')
|
</if>
|
<if test="query.freezeStatus != null and query.freezeStatus != ''">
|
and freeze_status = #{query.freezeStatus}
|
</if>
|
</where>
|
ORDER BY create_time DESC
|
</select>
|
<select id="queryPreAuditPage"
|
resultType="com.panzhihua.sangeshenbian.warpper.PendingPartyMemberApplicationVO">
|
SELECT
|
id,
|
audit_status,
|
`name`,
|
gender,
|
id_number,
|
phone,
|
districts,
|
street,
|
community,
|
service_target,
|
party_organization,
|
avatar,
|
create_time
|
FROM
|
sgsb_party_member
|
WHERE
|
audit_status = 0 and del_flag = 0
|
<if test="accountLevel==2">
|
and districts_code = #{districtsCode}
|
</if>
|
<if test="accountLevel==3">
|
and street_id = #{streetId}
|
</if>
|
<if test="accountLevel==4">
|
and community_id = #{communityId}
|
</if>
|
</select>
|
</mapper>
|