BUGFIX: 查询affiliate时,不显示已删除的记录,删除affiliate时,状态也修改
This commit is contained in:
@@ -212,10 +212,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
|
|||||||
|
|
||||||
// operationType Active -> 激活 | Inactive -> 关闭 | Delete -> 删除
|
// operationType Active -> 激活 | Inactive -> 关闭 | Delete -> 删除
|
||||||
if (!StringUtil.isNullOrEmpty(operationType)) {
|
if (!StringUtil.isNullOrEmpty(operationType)) {
|
||||||
if (operationType.equals("Delete")) {
|
if (operationType.equals("Delete") || operationType.equals("Active") || operationType.equals("Inactive")) {
|
||||||
baseMapper.deleteById(id);
|
|
||||||
return;
|
|
||||||
} else if (operationType.equals("Active") || operationType.equals("Inactive")) {
|
|
||||||
affiliate.setStatus(operationType);
|
affiliate.setStatus(operationType);
|
||||||
} else {
|
} else {
|
||||||
throw new BusinessException("unknown.operationType");
|
throw new BusinessException("unknown.operationType");
|
||||||
@@ -223,6 +220,10 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
|
|||||||
}
|
}
|
||||||
affiliate.setUpdateTime(LocalDateTime.now());
|
affiliate.setUpdateTime(LocalDateTime.now());
|
||||||
baseMapper.updateById(affiliate);
|
baseMapper.updateById(affiliate);
|
||||||
|
|
||||||
|
if (operationType.equals("Delete")) {
|
||||||
|
baseMapper.deleteById(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 定时计算佣金
|
// 定时计算佣金
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
<if test="affiliateId != null">
|
<if test="affiliateId != null">
|
||||||
AND f.id = #{affiliateId}
|
AND f.id = #{affiliateId}
|
||||||
</if>
|
</if>
|
||||||
|
AND f.is_deleted = 0
|
||||||
</where>
|
</where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="sortField != null and sortField != ''">
|
<when test="sortField != null and sortField != ''">
|
||||||
@@ -83,6 +84,7 @@
|
|||||||
AND f.id = #{affiliateId}
|
AND f.id = #{affiliateId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
AND f.is_deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllAffiliateUsername" resultType="java.util.Map">
|
<select id="selectAllAffiliateUsername" resultType="java.util.Map">
|
||||||
|
|||||||
Reference in New Issue
Block a user