去除业务表的逻辑删除字段

This commit is contained in:
cjw 2024-06-27 10:10:16 +08:00
parent 5a1c3a7c14
commit 770220bd10
9 changed files with 6 additions and 53 deletions

View File

@ -57,11 +57,5 @@ public class SysCatalogResource extends TenantEntity {
*/ */
private Long cover; private Long cover;
/**
* 删除标志0代表存在 2代表删除
*/
@TableLogic
private String delFlag;
} }

View File

@ -52,11 +52,4 @@ public class SysCatalogTextbook extends TenantEntity {
*/ */
private Integer type; private Integer type;
/**
* 删除标志0代表存在 2代表删除
*/
@TableLogic
private String delFlag;
} }

View File

@ -57,11 +57,4 @@ public class SysHomeBanner extends TenantEntity {
*/ */
private Integer status; private Integer status;
/**
* 删除标志0代表存在 2代表删除
*/
@TableLogic
private String delFlag;
} }

View File

@ -2,7 +2,6 @@ package org.dromara.system.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -65,11 +64,4 @@ public class SysHomeShow extends TenantEntity {
*/ */
private Integer status; private Integer status;
/**
* 删除标志0代表存在 2代表删除
*/
@TableLogic
private String delFlag;
} }

View File

@ -57,11 +57,4 @@ public class SysHomeTrend extends TenantEntity {
*/ */
private Integer status; private Integer status;
/**
* 删除标志0代表存在 2代表删除
*/
@TableLogic
private String delFlag;
} }

View File

@ -2,7 +2,6 @@ package org.dromara.system.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -85,12 +84,4 @@ public class SysTeacher extends TenantEntity {
* 出生日期 * 出生日期
*/ */
private Date birthday; private Date birthday;
/**
* 删除标志0代表存在 2代表删除
*/
@TableLogic
private String delFlag;
} }

View File

@ -222,7 +222,6 @@ public class SysCatalogResourceServiceImpl implements ISysCatalogResourceService
@Override @Override
public List<Tree<Long>> buildTreeSelect(SysCatalogResourceBo bo) { public List<Tree<Long>> buildTreeSelect(SysCatalogResourceBo bo) {
LambdaQueryWrapper<SysCatalogResource> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<SysCatalogResource> lqw = buildQueryWrapper(bo);
lqw.eq(SysCatalogResource::getDelFlag, 0);
List<SysCatalogResourceVo> voList = baseMapper.selectVoList(lqw); List<SysCatalogResourceVo> voList = baseMapper.selectVoList(lqw);
return buildCatalogTreeSelect(voList); return buildCatalogTreeSelect(voList);
} }

View File

@ -7,7 +7,6 @@
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>
@ -19,7 +18,6 @@
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>
@ -28,10 +26,11 @@
<select id="selectTeacherNum" resultType="int"> <select id="selectTeacherNum" resultType="int">
select count(*) select count(*)
from sys_teacher from sys_teacher
where del_flag = 0 <where>
<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">

View File

@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select cr.catalog_id,cr.parent_id, cr.catalog_name, cr.order_num, count(sor.oss_id) as `resourceNum` select cr.catalog_id,cr.parent_id, cr.catalog_name, cr.order_num, count(sor.oss_id) as `resourceNum`
from sys_catalog_resource cr from sys_catalog_resource cr
left join sys_oss_resource sor on sor.catalog_id = cr.catalog_id left join sys_oss_resource sor on sor.catalog_id = cr.catalog_id
where cr.del_flag = 0 and FIND_IN_SET(#{catalogId}, cr.ancestors) where FIND_IN_SET(#{catalogId}, cr.ancestors)
group by cr.catalog_id group by cr.catalog_id
having cr.parent_id = #{catalogId} having cr.parent_id = #{catalogId}
order by cr.order_num order by cr.order_num
@ -23,7 +23,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sys_catalog_resource cr from sys_catalog_resource cr
left join sys_oss_resource r on r.catalog_id = cr.catalog_id and r.status = 1 left join sys_oss_resource r on r.catalog_id = cr.catalog_id and r.status = 1
where cr.type = 2 where cr.type = 2
and cr.del_flag = 0
and cr.tenant_id = #{tenantId} and cr.tenant_id = #{tenantId}
group by cr.catalog_id group by cr.catalog_id
</select> </select>