<?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.errand.mapper.CommunityMapper">
|
|
<resultMap id="communityListVO" type="com.ruoyi.errand.object.vo.app.CommunityListVO">
|
<id column="id" property="id"/>
|
<result column="name" property="name"/>
|
</resultMap>
|
|
<select id="selectListByRegionId" resultMap="communityListVO">
|
select id ,name
|
from t_community where region_id = #{regionId}
|
and del_flag=0
|
and status = 0
|
</select>
|
<select id="getTotalCommunityList" resultType="com.ruoyi.errand.object.vo.app.CommunityListVO">
|
select id ,name
|
from t_community where del_flag=0
|
</select>
|
<select id="getAllCommunityList" resultType="com.ruoyi.errand.object.vo.sys.AllCommunityListVO">
|
select
|
id as communityId,
|
name as name
|
from
|
t_community
|
where
|
del_flag=0
|
and
|
id not in
|
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
|
#{item}
|
</foreach>
|
</select>
|
<select id="getCommunityPageList" resultType="com.ruoyi.errand.object.vo.sys.CommunityPageListVO">
|
select
|
tc.id,
|
tc.name as name,
|
tr.name as regionName,
|
tc.admin_name as adminName,
|
tc.admin_phone as adminPhone,
|
tco.name as courierName,
|
tc.status as status
|
from t_community tc
|
left join t_region tr on tc.region_id = tr.id
|
left join t_community_courier tcc on tc.id = tcc.community_id
|
left join t_courier tco on tcc.courier_id = toc.id
|
where
|
del_flag=0
|
<if test="dto.name !=null and ''!= dto.name">
|
and tc.name like concat('%',#{dto.name},'%')
|
</if>
|
<if test="dto.regionId!=null">
|
and tc.region_id =#{dto.regionId}
|
</if>
|
<if test="dto.adminName !=null and ''!= dto.adminName">
|
and tc.admin_name like concat('%',#{dto.adminName},'%')
|
</if>
|
<if test="dto.adminPhone !=null and ''!= dto.adminPhone">
|
and tc.admin_phone like concat('%',#{dto.adminPhone},'%')
|
</if>
|
<if test="dto.courierName !=null and ''!= dto.courierName">
|
and tco.name like concat('%',#{dto.courierName},'%')
|
</if>
|
<if test="dto.status!=null">
|
and tc.status =#{dto.status}
|
</if>
|
</select>
|
</mapper>
|