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.
291 lines
12 KiB
291 lines
12 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.research.system.persist.dao.KtsGroupDao">
|
|
|
|
<select id="queryGroupList" resultType="com.research.system.domain.vo.GroupVO$Result">
|
|
select
|
|
g.id,
|
|
g.proj_id as projId,
|
|
g.proj_org_id as projOrgId,
|
|
g.parent_kt_id as parentKtId,
|
|
g.kt_group_name as ktGroupName,
|
|
g.sort,
|
|
g.intro,
|
|
g.kt_group_status as ktGroupStatus,
|
|
g.create_by as createBy,
|
|
g.create_time as createTime,
|
|
o.org_name as projOrgName,
|
|
pg.kt_group_name as parentKtName,
|
|
g.name as name,
|
|
g.phone as phone,
|
|
g.plan_status as planStatus,
|
|
g.develop_status as developStatus,
|
|
g.target,
|
|
g.plan
|
|
from kts_kt_group g
|
|
left join
|
|
prj_proj_org o on g.proj_org_id = o.id
|
|
left join
|
|
kts_kt_group pg on g.parent_kt_id = pg.id
|
|
where 1=1
|
|
and g.del_flag = 0
|
|
<if test="dto.idList != null and dto.idList.size()>0">
|
|
and g.id in
|
|
<foreach item="item" collection="dto.idList" separator="," open="(" close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test="dto.projOrgId != null">
|
|
and g.proj_org_id = #{dto.projOrgId}
|
|
</if>
|
|
<if test="dto.ktGroupStatus != null">
|
|
and g.kt_group_status = #{dto.ktGroupStatus}
|
|
</if>
|
|
<if test="dto.ktGroupName != null and dto.ktGroupName != ''">
|
|
and g.kt_group_name like concat('%',#{dto.ktGroupName},'%')
|
|
</if>
|
|
<if test="dto.planStatus != null">
|
|
and g.plan_status = #{dto.planStatus}
|
|
</if>
|
|
<if test="dto.developStatus != null">
|
|
and g.develop_status = #{dto.developStatus}
|
|
</if>
|
|
group by g.id
|
|
order by g.parent_kt_id,g.id
|
|
</select>
|
|
|
|
<select id="queryMemberList" resultType="com.research.system.domain.vo.GroupVO$MemberResult">
|
|
select
|
|
m.id,
|
|
m.user_id as userId,
|
|
m.kt_group_id as ktGroupId,
|
|
m.parent_member_id as parentMemberId,
|
|
m.member_name as memberName,
|
|
m.member_phone as memberPhone,
|
|
m.member_email as memberEmail,
|
|
m.member_gender as memberGender,
|
|
m.member_birth as memberBirth,
|
|
m.type,
|
|
m.category,
|
|
m.qualification,
|
|
m.title,
|
|
m.sort,
|
|
m.intro,
|
|
m.audit_status as auditStatus,
|
|
m.member_status as memberStatus,
|
|
m.create_by as createBy,
|
|
m.create_time as createTime,
|
|
g.kt_group_name as ktGroupName,
|
|
d1.dict_label as qualificationName,
|
|
o.org_name as projOrgName,
|
|
o.id as orgId,
|
|
u.user_name as userName,
|
|
u.nick_name as nickName,
|
|
m.enroll_time as enrollmentTime,
|
|
m.graduation_time as graduationTime
|
|
from
|
|
kts_kt_group_member m
|
|
left join
|
|
kts_kt_group g on m.kt_group_id = g.id
|
|
left join sys_dict_data d1 on d1.dict_value = m.qualification and d1.dict_type = 'qualification'
|
|
left join sys_dict_data d2 on d2.dict_value = m.title and d2.dict_type = 'sys_title'
|
|
left join prj_proj_org o on o.id = g.proj_org_id
|
|
left join sys_user u on u.user_id = m.user_id
|
|
where 1=1
|
|
and m.del_flag = 0
|
|
<if test="dto.ktGroupId != null">
|
|
and m.kt_group_id = #{dto.ktGroupId}
|
|
</if>
|
|
<if test="dto.memberName != null and dto.memberName != ''">
|
|
and m.member_name like concat('%',#{dto.memberName},'%')
|
|
</if>
|
|
<if test="dto.memberPhone != null and dto.memberPhone != ''">
|
|
and m.member_phone like concat('%',#{dto.memberPhone},'%')
|
|
</if>
|
|
<if test="dto.type != null">
|
|
and m.type = #{dto.type}
|
|
</if>
|
|
<if test="dto.auditStatus != null">
|
|
and m.audit_status = #{dto.auditStatus}
|
|
</if>
|
|
<if test="dto.memberStatus != null">
|
|
and m.member_status = #{dto.memberStatus}
|
|
</if>
|
|
<if test="dto.category != null">
|
|
and m.category = #{dto.category}
|
|
</if>
|
|
order by m.kt_group_id,m.id
|
|
</select>
|
|
|
|
<select id="queryNum" resultType="com.research.system.domain.vo.GroupVO$Num">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
count(g.id) as num
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
where o.del_flag = 0
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="jhzt" resultType="com.research.system.domain.vo.GroupVO$Num1">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN plan_status = '0' THEN 1 ELSE 0 END) AS jhn,
|
|
SUM(CASE WHEN plan_status = '1' THEN 1 ELSE 0 END) AS jhw,
|
|
count(g.id) as total
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
where o.del_flag = 0
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="kzzt" resultType="com.research.system.domain.vo.GroupVO$Num2">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN develop_status = '0' THEN 1 ELSE 0 END) AS befor,
|
|
SUM(CASE WHEN develop_status = '1' THEN 1 ELSE 0 END) AS ing,
|
|
SUM(CASE WHEN develop_status = '2' THEN 1 ELSE 0 END) AS after
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
where o.del_flag = 0
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="queryMemberStatistics" resultType="com.research.system.domain.vo.GroupVO$Statistics$Member">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
COUNT(m.id) as num,
|
|
SUM(CASE WHEN m.graduation_time > now() THEN 1 ELSE 0 END) AS zdNum,
|
|
SUM(CASE WHEN m.graduation_time < now() THEN 1 ELSE 0 END) AS byNum
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id
|
|
where o.del_flag = 0
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="queryZcStatistics" resultType="com.research.system.domain.vo.GroupVO$Statistics$Zc">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN m.title = '0' THEN 1 ELSE 0 END) AS js,
|
|
SUM(CASE WHEN m.title = '1' THEN 1 ELSE 0 END) AS fjs,
|
|
SUM(CASE WHEN m.title = '2' THEN 1 ELSE 0 END) AS zgjs
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id
|
|
where o.del_flag = 0
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="queryXlStatistics" resultType="com.research.system.domain.vo.GroupVO$Statistics$Xl">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN m.qualification = '5' THEN 1 ELSE 0 END) AS bk,
|
|
SUM(CASE WHEN m.qualification = '6' THEN 1 ELSE 0 END) AS ss,
|
|
SUM(CASE WHEN m.qualification = '7' THEN 1 ELSE 0 END) AS bs
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id
|
|
where o.del_flag = 0
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="queryZdXlStatistics" resultType="com.research.system.domain.vo.GroupVO$Statistics$Xl">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN m.qualification = '5' THEN 1 ELSE 0 END) AS ss,
|
|
SUM(CASE WHEN m.qualification = '6' THEN 1 ELSE 0 END) AS bs,
|
|
SUM(CASE WHEN m.qualification = '7' THEN 1 ELSE 0 END) AS bsh
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id and m.graduation_time > now()
|
|
where o.del_flag = 0
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="queryByXlStatistics" resultType="com.research.system.domain.vo.GroupVO$Statistics$Xl">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN m.qualification = '5' THEN 1 ELSE 0 END) AS ss,
|
|
SUM(CASE WHEN m.qualification = '6' THEN 1 ELSE 0 END) AS bs,
|
|
SUM(CASE WHEN m.qualification = '7' THEN 1 ELSE 0 END) AS bsh
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id and m.graduation_time < now()
|
|
where o.del_flag = 0
|
|
group by o.id
|
|
</select>
|
|
|
|
|
|
<select id="queryGjTitleStatistics" resultType="com.research.system.domain.vo.GroupVO$WorkerStatistics$Title$GjDto">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN FIND_IN_SET('1', m.title) > 0 THEN 1 ELSE 0 END) AS js,
|
|
SUM(CASE WHEN FIND_IN_SET('5', m.title) > 0 THEN 1 ELSE 0 END) AS yjy,
|
|
SUM(CASE WHEN FIND_IN_SET('8', m.title) > 0 THEN 1 ELSE 0 END) AS zrys,
|
|
SUM(CASE WHEN FIND_IN_SET('12', m.title) > 0 THEN 1 ELSE 0 END) AS gjgcs
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id
|
|
where o.del_flag = 0
|
|
and o.id = #{orgId}
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="queryFgjTitleStatistics" resultType="com.research.system.domain.vo.GroupVO$WorkerStatistics$Title$FgjDto">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN FIND_IN_SET('2', m.title) > 0 THEN 1 ELSE 0 END) AS fjs,
|
|
SUM(CASE WHEN FIND_IN_SET('6', m.title) > 0 THEN 1 ELSE 0 END) AS fyjy,
|
|
SUM(CASE WHEN FIND_IN_SET('8', m.title) > 0 THEN 1 ELSE 0 END) AS fzrys,
|
|
SUM(CASE WHEN FIND_IN_SET('13', m.title) > 0 THEN 1 ELSE 0 END) AS fgjgcs
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id
|
|
where o.del_flag = 0
|
|
and o.id = #{orgId}
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="queryCjTitleStatistics" resultType="com.research.system.domain.vo.GroupVO$WorkerStatistics$Title$CjDto">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN FIND_IN_SET('4', m.title) > 0 THEN 1 ELSE 0 END) AS zj,
|
|
SUM(CASE WHEN FIND_IN_SET('7', m.title) > 0 THEN 1 ELSE 0 END) AS zlyjy,
|
|
SUM(CASE WHEN FIND_IN_SET('11', m.title) > 0 THEN 1 ELSE 0 END) AS zrys,
|
|
SUM(CASE WHEN FIND_IN_SET('15', m.title) > 0 THEN 1 ELSE 0 END) AS zlgcs,
|
|
SUM(CASE WHEN FIND_IN_SET('16', m.title) > 0 THEN 1 ELSE 0 END) AS jsy
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id
|
|
where o.del_flag = 0
|
|
and o.id = #{orgId}
|
|
group by o.id
|
|
</select>
|
|
|
|
<select id="queryZjTitleStatistics" resultType="com.research.system.domain.vo.GroupVO$WorkerStatistics$Title$ZjDto">
|
|
select o.id as orgId,
|
|
o.org_name as orgName,
|
|
SUM(CASE WHEN FIND_IN_SET('3', m.title) > 0 THEN 1 ELSE 0 END) AS js,
|
|
SUM(CASE WHEN FIND_IN_SET('10', m.title) > 0 THEN 1 ELSE 0 END) AS zzys,
|
|
SUM(CASE WHEN FIND_IN_SET('14', m.title) > 0 THEN 1 ELSE 0 END) AS gcs
|
|
from prj_proj_org o
|
|
left join
|
|
kts_kt_group g on g.proj_org_id = o.id and g.del_flag = 0
|
|
LEFT JOIN kts_kt_group_member m on m.kt_group_id = g.id
|
|
where o.del_flag = 0
|
|
and o.id = #{orgId}
|
|
group by o.id
|
|
</select>
|
|
</mapper>
|
|
|