统计接口区分删除数据

This commit is contained in:
cjw 2024-06-26 18:55:12 +08:00
parent 64063390bd
commit 516a6aa641
1 changed files with 18 additions and 20 deletions

View File

@ -7,6 +7,7 @@
select count(d.dept_id) select count(d.dept_id)
from sys_dept d left join sys_dept p on p.dept_id = d.parent_id from sys_dept d left join sys_dept p on p.dept_id = d.parent_id
where p.parent_id = 0 where p.parent_id = 0
and d.del_flag = 0
<if test="tenantId != null and tenantId != ''"> <if test="tenantId != null and tenantId != ''">
and d.tenant_id = #{tenantId} and d.tenant_id = #{tenantId}
</if> </if>
@ -18,6 +19,7 @@
left join sys_dept p on d.parent_id = p.dept_id left join sys_dept p on d.parent_id = p.dept_id
left join sys_dept pp on pp.dept_id = p.parent_id left join sys_dept pp on pp.dept_id = p.parent_id
where pp.parent_id = 0 where pp.parent_id = 0
and d.del_flag = 0
<if test="tenantId != null and tenantId != ''"> <if test="tenantId != null and tenantId != ''">
and d.tenant_id = #{tenantId} and d.tenant_id = #{tenantId}
</if> </if>
@ -26,31 +28,28 @@
<select id="selectTeacherNum" resultType="int"> <select id="selectTeacherNum" resultType="int">
select count(*) select count(*)
from sys_teacher from sys_teacher
<where> where del_flag = 0
<if test="tenantId != null and tenantId != ''"> <if test="tenantId != null and tenantId != ''">
and tenant_id = #{tenantId} and tenant_id = #{tenantId}
</if> </if>
</where>
</select> </select>
<select id="selectTextbookNum" resultType="int"> <select id="selectTextbookNum" resultType="int">
select count(*) select count(*)
from sys_oss_textbook from sys_oss_textbook
<where> where status = 1
<if test="tenantId != null and tenantId != ''"> <if test="tenantId != null and tenantId != ''">
and tenant_id = #{tenantId} and tenant_id = #{tenantId}
</if> </if>
</where>
</select> </select>
<select id="selectResourceNum" resultType="int"> <select id="selectResourceNum" resultType="int">
select count(*) as rNum select count(*) as rNum
from sys_oss_resource from sys_oss_resource
<where> where status = 1
<if test="tenantId != null and tenantId != ''"> <if test="tenantId != null and tenantId != ''">
and tenant_id = #{tenantId} and tenant_id = #{tenantId}
</if> </if>
</where>
</select> </select>
<select id="selectOssUse" resultType="org.dromara.system.domain.vo.StatisticNumVo"> <select id="selectOssUse" resultType="org.dromara.system.domain.vo.StatisticNumVo">
@ -86,11 +85,10 @@
when 4 then '试卷' when 4 then '试卷'
end as `name` end as `name`
from sys_oss_textbook from sys_oss_textbook
<where> where status = 1
<if test="tenantId != null and tenantId != ''"> <if test="tenantId != null and tenantId != ''">
and tenant_id = #{tenantId} and tenant_id = #{tenantId}
</if> </if>
</where>
group by type group by type
</select> </select>
</mapper> </mapper>