2023年6月29日 添加假删除(课堂)

This commit is contained in:
bai 2023-06-29 00:13:38 +08:00
parent 6d3a257f2c
commit 6739a2d689
3 changed files with 19 additions and 2 deletions

View File

@ -15,6 +15,7 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.CommonAPI;
@ -149,7 +150,11 @@ public class KcKetangbiaoController extends JeecgController<KcKetangbiao, IKcKet
// @RequiresPermissions("ktgl:kc_ketangbiao:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
kcKetangbiaoService.removeById(id);
UpdateWrapper<KcKetangbiao> uw = new UpdateWrapper<>();
uw.set("is_delete",1);
uw.eq("id",id);
// kcKetangbiaoService.removeById(id);
kcKetangbiaoService.update(uw);
return Result.OK("删除成功!");
}
@ -164,7 +169,12 @@ public class KcKetangbiaoController extends JeecgController<KcKetangbiao, IKcKet
// @RequiresPermissions("ktgl:kc_ketangbiao:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.kcKetangbiaoService.removeByIds(Arrays.asList(ids.split(",")));
// this.kcKetangbiaoService.removeByIds(Arrays.asList(ids.split(",")));
UpdateWrapper<KcKetangbiao> uw = new UpdateWrapper<>();
uw.set("is_delete",1);
uw.in("id",Arrays.asList(ids.split(",")));
// kcKetangbiaoService.removeById(id);
kcKetangbiaoService.update(uw);
return Result.OK("批量删除成功!");
}

View File

@ -242,6 +242,12 @@ public class KcKetangbiao implements Serializable {
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
private java.lang.String zt;
/**是否删除0未删除1已删除*/
@Excel(name = "是否删除0未删除1已删除", width = 15)
@ApiModelProperty(value = "是否删除0未删除1已删除")
private java.lang.Integer isDelete;
@TableField(exist = false)
private String jssj;

View File

@ -43,6 +43,7 @@
left join xxhbjxljbxx jxljbxx on jsjbxx.jxlh = jxljbxx.jzwh
left join kc_jieci jc on ktb.hh = jc.jieci
<where>
and ktb.is_delete = 0
<if test="kcKetangbiao.ywmc!=null and kcKetangbiao.ywmc!=''">
and (ktb.skjs like concat('%',#{kcKetangbiao.ywmc},'%') or ktb.kcmc like concat('%',#{kcKetangbiao.ywmc},'%') )
</if>