<?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.ComSanshuoExpertDao">
|
|
<resultMap id="BaseResultMap" type="com.panzhihua.service_community.entity.ComSanshuoExpert">
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
<result property="level" column="level" jdbcType="TINYINT"/>
|
<result property="communityId" column="community_id" jdbcType="BIGINT"/>
|
<result property="workTime" column="work_time" jdbcType="VARCHAR"/>
|
<result property="goodAt" column="good_at" jdbcType="VARCHAR"/>
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
<result property="avatar" column="avatar" jdbcType="VARCHAR"/>
|
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
<result property="account" column="account" jdbcType="VARCHAR"/>
|
<result property="password" column="password" jdbcType="VARCHAR"/>
|
<result property="status" column="status" jdbcType="VARCHAR"/>
|
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
<result property="introduction" column="introduction" jdbcType="VARCHAR"/>
|
<result property="streetId" column="street_id" jdbcType="BIGINT"/>
|
<result property="industryCenterId" column="industry_center_id" jdbcType="VARCHAR"/>
|
<result property="param1" column="param1" jdbcType="VARCHAR"/>
|
<result property="unit" column="unit" jdbcType="VARCHAR"/>
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
select id,level,community_id,
|
work_time,good_at,name,
|
avatar,phone,account,
|
password,status,del_flag,
|
create_time,create_by,update_time,
|
introduction,street_id,industry_center_id,
|
unit_id,unit from com_sanshuo_expert
|
</sql>
|
<select id="expertShow" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
|
select count(id) as 'count',level from com_sanshuo_expert where status=1 and del_flag=1 and app_id=#{appId} group by level
|
</select>
|
<select id="expertPage" resultType="com.panzhihua.common.model.vos.sanshuo.ComSanshuoExpertVO">
|
select id,level,community_id,
|
work_time,good_at,name,
|
avatar,phone,account,
|
password,status,del_flag,
|
create_time,create_by,update_time,
|
introduction,street_id,industry_center_id,
|
unit_id,unit from com_sanshuo_expert
|
where del_flag=1
|
AND app_id=#{appId}
|
<if test="keyWord != null and keyWord != ''">
|
AND unit like concat('%',#{keyWord},'%')
|
OR name like concat('%',#{keyWord},'%')
|
OR phone like concat('%',#{keyWord},'%')
|
</if>
|
<if test="level != null ">
|
AND level=#{level}
|
<if test="level == 2">
|
<if test="id != null">
|
AND industry_center_id=#{id}
|
</if>
|
</if>
|
<if test="level == 3">
|
<if test="id != null">
|
AND street_id=#{id}
|
</if>
|
</if>
|
<if test="level == 4">
|
<if test="id != null">
|
AND community_id=#{id}
|
</if>
|
</if>
|
</if>
|
<if test="level == null">
|
<if test="range != null and range != ''">
|
<if test="range == 3">
|
AND street_id=#{id}
|
</if>
|
<if test="range == 4">
|
AND community_id=#{id}
|
</if>
|
<if test="range == 2">
|
AND industry_center_id=#{id}
|
</if>
|
<if test="range == 1">
|
AND level=1
|
</if>
|
</if>
|
</if>
|
</select>
|
<select id="selectExpertIndustry" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
|
select count(t.id) as 'count',t1.name,t1.id,t.level from com_sanshuo_expert t
|
left join com_sanshuo_industry_center t1 on t.industry_center_id=t1.id
|
where t.level=2 and t.status=1 and t.del_flag=1
|
group by t1.name
|
</select>
|
|
|
<select id="selectExpertStreet" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
|
select count(t.id) as 'count',t1.name,t1.street_id as id,t.level from com_sanshuo_expert t
|
left join com_street t1 on t.street_id=t1.street_id
|
where t.level=3 and t.status=1 and t.del_flag=1
|
group by t1.name
|
</select>
|
<select id="selectExpertCommunity" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
|
select count(t.id) as 'count',t1.name,t1.community_id as id,t.level from com_sanshuo_expert t
|
left join com_act t1 on t.community_id=t1.community_id
|
where t.level=4 and t.status=1 and t.del_flag=1 and t.app_id=#{appId}
|
group by t1.name
|
</select>
|
<select id="selectExpertList" resultType="com.panzhihua.service_community.entity.ComSanshuoExpert">
|
select t.*,count (select id from com_sanshuo_event_info where specialist_id = t.id )from com_sanshuo_expert as t
|
left join com_sanshuo_event_info t1 on t.id=t1.specialist_id
|
where t.status=1 and t.del_flag=1
|
</select>
|
<select id="selectExpertByNameOrPhoneOrAccount"
|
resultType="com.panzhihua.service_community.entity.ComSanshuoExpert">
|
select * from com_sanshuo_expert where name=#{dto.name} or phone=#{dto.phone} or account=#{dto.account}
|
and status=1 and del_flag=1
|
</select>
|
<select id="selectExpertCount" resultType="Integer">
|
select count(id) from com_sanshuo_expert
|
where del_flag=1 and status=1 and app_id='wx0cef797390444b75'
|
<if test="dto.type != null">
|
<if test="dto.type == 2">
|
AND level=2
|
<if test="dto.id != null">
|
AND industry_center_id=#{dto.id}
|
</if>
|
</if>
|
<if test="dto.type == 3">
|
AND level=3
|
<if test="dto.id != null">
|
AND street_id=#{dto.id}
|
</if>
|
</if>
|
<if test="dto.type == 4">
|
AND level=4
|
<if test="dto.id != null">
|
AND community_id=#{dto.id}
|
</if>
|
</if>
|
<if test="dto.type == 1">
|
AND level=1
|
</if>
|
</if>
|
</select>
|
<select id="selectExpertVoList" resultType="Integer">
|
select count(id) from com_sanshuo_expert where level=1
|
</select>
|
<select id="expertList" resultType="com.panzhihua.common.model.vos.sanshuo.ComSanshuoExpertVO">
|
select id,level,community_id,
|
work_time,good_at,name,
|
avatar,phone,account,
|
password,status,del_flag,
|
create_time,create_by,update_time,
|
introduction,street_id,industry_center_id,
|
unit_id,unit from com_sanshuo_expert
|
where del_flag=1
|
AND app_id=#{appId}
|
<if test="keyWord != null and keyWord != ''">
|
AND name like concat('%',#{keyWord},'%') or phone like concat('%',#{keyWord},'%') or unit like concat('%',#{keyWord},'%')
|
</if>
|
<if test="level != null">
|
<if test="level == 2">
|
AND level = 2
|
<if test="id != null">
|
AND industry_center_id=#{id}
|
</if>
|
</if>
|
<if test="level == 3">
|
AND level = 3
|
<if test="id != null">
|
AND street_id=#{id}
|
</if>
|
</if>
|
<if test="level == 4">
|
AND level = 4
|
<if test="id != null">
|
AND community_id=#{id}
|
</if>
|
</if>
|
</if>
|
</select>
|
</mapper>
|