You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
3.8 KiB
102 lines
3.8 KiB
<?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.elink.esua.epdc.dao.PartyGroupDao">
|
|
|
|
<resultMap type="com.elink.esua.epdc.entity.PartyGroupEntity" id="partyGroupMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="partyGroupName" column="PARTY_GROUP_NAME"/>
|
|
<result property="partyGroupAvatar" column="PARTY_GROUP_AVATAR"/>
|
|
<result property="groupIntroduction" column="GROUP_INTRODUCTION"/>
|
|
<result property="dept" column="DEPT"/>
|
|
<result property="deptId" column="DEPT_ID"/>
|
|
<result property="state" column="STATE"/>
|
|
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
|
|
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
|
|
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
|
|
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectListOfGroupByDeptId" resultType="com.elink.esua.epdc.dto.PartyGroupListDTO">
|
|
SELECT
|
|
ID AS groupId,
|
|
PARTY_GROUP_NAME AS partyGroupName
|
|
FROM
|
|
epdc_party_group
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND find_in_set(#{deptId},ALL_DEPT_IDS)
|
|
</select>
|
|
|
|
<select id="selectListOfPartyGroupDTO" resultType="com.elink.esua.epdc.dto.PartyGroupDTO">
|
|
select
|
|
t.ID,
|
|
t.PARTY_GROUP_NAME,
|
|
t.PARTY_GROUP_AVATAR,
|
|
t.GROUP_INTRODUCTION,
|
|
t.DEPT,
|
|
t.DEPT_ID,
|
|
t.STATE,
|
|
t.ALL_DEPT_IDS,
|
|
t.ALL_DEPT_NAMES,
|
|
t.PARENT_DEPT_IDS,
|
|
t.PARENT_DEPT_NAMES,
|
|
t.DEL_FLAG,
|
|
t.REVISION,
|
|
t.CREATED_BY,
|
|
t.CREATED_TIME,
|
|
t.UPDATED_BY,
|
|
t.UPDATED_TIME,
|
|
t1.NICKNAME
|
|
from epdc_party_group t
|
|
left join (select PARTY_GROUP_ID,NICKNAME from epdc_party_user_group where IDENTITY_FLAG = '1' and DEL_FLAG='0' and STATE='0') t1 on t.ID = t1.PARTY_GROUP_ID
|
|
where t.DEL_FLAG ='0'
|
|
order by CREATED_TIME desc
|
|
</select>
|
|
|
|
|
|
<select id="selectDetailById" resultType="com.elink.esua.epdc.dto.PartyGroupDTO">
|
|
select
|
|
t.ID,
|
|
t.PARTY_GROUP_NAME,
|
|
t.PARTY_GROUP_AVATAR,
|
|
t.GROUP_INTRODUCTION,
|
|
t.DEPT,
|
|
t.DEPT_ID,
|
|
t.STATE,
|
|
t.ALL_DEPT_IDS,
|
|
t.ALL_DEPT_NAMES,
|
|
t.PARENT_DEPT_IDS,
|
|
t.PARENT_DEPT_NAMES,
|
|
t.DEL_FLAG,
|
|
t.REVISION,
|
|
t.CREATED_BY,
|
|
t.CREATED_TIME,
|
|
t.UPDATED_BY,
|
|
t.UPDATED_TIME,
|
|
t1.NICKNAME,
|
|
t1.USER_ID
|
|
from epdc_party_group t
|
|
left join (select PARTY_GROUP_ID,NICKNAME,USER_ID from epdc_party_user_group where IDENTITY_FLAG = '1' and DEL_FLAG='0' and STATE='0') t1 on t.ID = t1.PARTY_GROUP_ID
|
|
where t.DEL_FLAG ='0' and t.ID = #{id}
|
|
</select>
|
|
|
|
|
|
<select id="getAllPartyGroup" resultType="com.elink.esua.epdc.dto.result.PartyGroupResultDTO">
|
|
select
|
|
t.ID,
|
|
t.PARTY_GROUP_NAME,
|
|
t.PARTY_GROUP_AVATAR,
|
|
if(t1.ID is not null ,1,0) as isJoin
|
|
from epdc_party_group t
|
|
left join epdc_party_user_group t1 on t1.PARTY_GROUP_ID = t.ID and t1.DEL_FLAG ='0' and t1.USER_ID=#{userId}
|
|
where t.DEL_FLAG ='0' and t.STATE ='0' order by t.CREATED_TIME desc
|
|
</select>
|
|
</mapper>
|