131 lines
6.2 KiB
XML
131 lines
6.2 KiB
XML
<?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.zcloud.eightwork.persistence.mapper.EightworkInfoMapper">
|
|
<select id="listPage" resultType="com.zcloud.eightwork.persistence.dataobject.EightworkInfoDO">
|
|
select t.*,c.corp_name as corpinfoName
|
|
from eightwork_info t
|
|
left join vi_corp_info c on t.corpinfo_id = c.id
|
|
where t.delete_enum = 'FALSE'
|
|
and t.status !=0
|
|
<if test="params.eqWorkType != null and params.eqWorkType != ''">
|
|
and t.work_type = #{params.eqWorkType}
|
|
</if>
|
|
<if test="params.eqCheckNo != null and params.eqCheckNo != ''">
|
|
and t.check_no like concat('%', #{params.eqCheckNo}, '%')
|
|
</if>
|
|
<if test="params.eqStatus != null">
|
|
and t.status = #{params.eqStatus}
|
|
</if>
|
|
<if test="params.eqWorkLevel != null and params.eqWorkLevel != ''">
|
|
and t.work_level = #{params.eqWorkLevel}
|
|
</if>
|
|
<if test="params.eqDepartmentId != null">
|
|
and t.department_id = #{params.eqDepartmentId}
|
|
</if>
|
|
<if test="params.eqXgfFlag != null">
|
|
and t.xgf_flag = #{params.eqXgfFlag}
|
|
</if>
|
|
<if test="params.eqInternalOperationFlag != null">
|
|
and t.internal_operation_flag = #{params.eqInternalOperationFlag}
|
|
</if>
|
|
<if test="params.eqProjectId != null and params.eqProjectId != ''">
|
|
and t.project_id = #{params.eqProjectId}
|
|
</if>
|
|
<if test="params.eqWorkDepartmentId != null">
|
|
and exists (select 1
|
|
from task_log log
|
|
where log.work_id = t.work_id
|
|
and log.act_user_department = #{params.eqWorkDepartmentId})
|
|
</if>
|
|
<if test="params.eqWorkUserId != null">
|
|
and exists (select 1
|
|
from task_log log
|
|
where log.work_id = t.work_id
|
|
and log.act_user = #{params.eqWorkUserId})
|
|
</if>
|
|
<if test="params.inDepartmentId != null and params.inDepartmentId.size() > 0">
|
|
and t.department_id in
|
|
<foreach collection="params.inDepartmentId" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test="params.geCreateTime != null and params.geCreateTime != ''">
|
|
AND t.create_time >= DATE_FORMAT(CONCAT(#{params.geCreateTime}, ' 00:00:00'), '%Y-%m-%d %H:%i:%s')
|
|
</if>
|
|
<if test="params.leCreateTime != null and params.leCreateTime != ''">
|
|
AND t.create_time < DATE_FORMAT(DATE_ADD(#{params.leCreateTime}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%s')
|
|
</if>
|
|
|
|
<if test="params.eqIsInnerWork != null and params.eqIsInnerWork != ''">
|
|
and t.info->>'$.isInnerWork' = #{params.eqIsInnerWork}
|
|
</if>
|
|
<if test="params.likeCreateName != null and params.likeCreateName != ''">
|
|
and t.create_name like concat('%', #{params.likeCreateName}, '%')
|
|
</if>
|
|
<if test="params.likeWorkContent != null and params.likeWorkContent != ''">
|
|
and t.info->>'$.workContent' like concat('%', #{params.likeWorkContent}, '%')
|
|
</if>
|
|
<if test="params.eqBlindboardWorkType != null and params.eqBlindboardWorkType != ''">
|
|
and t.info->>'$.blindboardWorkType' = #{params.eqBlindboardWorkType}
|
|
</if>
|
|
<if test="params.geWorkStartTime != null and params.geWorkStartTime != ''">
|
|
and t.info->>'$.workStartTime' >= DATE_FORMAT(CONCAT(#{params.geWorkStartTime}, ' 00:00:00'), '%Y-%m-%d %H:%i:%s')
|
|
</if>
|
|
<if test="params.leWorkStartTime != null and params.leWorkStartTime != ''">
|
|
and t.info->>'$.workStartTime' < DATE_FORMAT(DATE_ADD(#{params.leWorkStartTime}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%s')
|
|
</if>
|
|
<if test="params.likeLimitedSpaceNameAndCode != null and params.likeLimitedSpaceNameAndCode != ''">
|
|
and t.info->>'$.limitedSpaceNameAndCode' like concat('%', #{params.likeLimitedSpaceNameAndCode}, '%')
|
|
</if>
|
|
<if test="params.eqCurrentStepId != null">
|
|
and exists (select 1
|
|
from task_log log
|
|
where log.work_id = t.work_id
|
|
and log.status = 0
|
|
and log.step_id = #{params.eqCurrentStepId})
|
|
</if>
|
|
<if test="params.inCorpInfoId != null and params.inCorpInfoId.size() > 0">
|
|
and t.corpinfo_id in
|
|
<foreach collection="params.inCorpInfoId" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test="params.corpinfoId != null">
|
|
and t.corpinfo_id = #{params.corpinfoId}
|
|
</if>
|
|
<if test="params.eqCreateId != null">
|
|
and t.create_id = #{params.eqCreateId}
|
|
</if> <if test="params.eqTenantId != null">
|
|
and t.tenant_id = #{params.eqTenantId}
|
|
</if>
|
|
ORDER BY
|
|
CASE WHEN t.status = 0 THEN 0 ELSE 1 END ASC,
|
|
t.create_time DESC
|
|
</select>
|
|
|
|
<select id="statisticsByWorkType" resultType="com.zcloud.eightwork.persistence.dataobject.dto.StatisticsByWorkTypeDTO">
|
|
select t.corpinfo_id,
|
|
sum(case t.status when 0 then 1 else 0 end) as draftCount,
|
|
sum(case t.status when 1 then 1 else 0 end) as doingCount,
|
|
sum(case t.status when 2 then 1 else 0 end) as rejectedCount,
|
|
sum(case t.status when 998 then 1 else 0 end) as forceTerminateCount,
|
|
sum(case t.status when 999 then 1 else 0 end) as doneCount
|
|
|
|
from eightwork_info t
|
|
where t.delete_enum = 'FALSE'
|
|
<if test="params.eqWorkType != null and params.eqWorkType != ''">
|
|
and t.work_type = #{params.eqWorkType}
|
|
</if>
|
|
<if test="params.inCorpInfoId != null and params.inCorpInfoId.size() > 0">
|
|
and t.corpinfo_id in
|
|
<foreach collection="params.inCorpInfoId" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
group by t.corpinfo_id
|
|
</select>
|
|
|
|
</mapper>
|