Эх сурвалжийг харах

履职内容定义及管理补全deleted,使用@tablelogic注解

jiawuxian 2 жил өмнө
parent
commit
d90ac41849

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/AppRuleController.java

@@ -63,7 +63,7 @@ public class AppRuleController  extends BaseController {
 
     @ApiOperation(value = "删除规范")
     @RequiresPermissions("resumption:rule:remove")
-    @GetMapping("del/{id}")
+    @DeleteMapping("{id}")
 
     public AjaxResult del(@PathVariable Long id) {
         appRuleService.del(id);

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRule.java

@@ -2,6 +2,7 @@ package com.xunmei.core.resumption.domain;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.xunmei.common.core.web.domain.BaseEntity;
 import io.swagger.annotations.ApiModel;
@@ -51,4 +52,8 @@ public class AppRule extends BaseEntity {
     @ApiModelProperty(value = "备注")
     @TableField("remark")
     private String remark;
+
+    @TableLogic(value = "0", delval = "1")
+    @ApiModelProperty(value = "是否删除 1是 0否")
+    private int deleted;
 }

+ 5 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRuleItem.java

@@ -1,9 +1,6 @@
 package com.xunmei.core.resumption.domain;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.xunmei.common.core.web.domain.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -42,4 +39,8 @@ public class AppRuleItem extends BaseEntity {
     @ApiModelProperty(value = "标准及要求")
     @TableField("`desc`")
     private String desc;
+
+    @TableLogic(value = "0", delval = "1")
+    @ApiModelProperty(value = "是否删除 1是 0否")
+    private int deleted;
 }

+ 3 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppRulePoint.java

@@ -49,11 +49,11 @@ public class AppRulePoint extends BaseEntity {
     @ApiModelProperty(value = "该要点关联的业务类型")
     private String businessType;
 
-   @ApiModelProperty(value = "时间类型,0无,1时分")
+    @ApiModelProperty(value = "时间类型,0无,1时分")
     @TableField("remark")
     private String remark;
 
-   @TableLogic(value = "0", delval = "1")
-    @ApiModelProperty(value = "是否禁用 1是 0否")
+    @TableLogic(value = "0", delval = "1")
+    @ApiModelProperty(value = "是否删除 1是 0否")
     private int deleted;
 }

+ 1 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppRuleItemMapper.xml

@@ -9,6 +9,7 @@
         ) as pointNums from
         core_resumption_rule_item i
         <where>
+            i.deleted=0
             <if test="itemPageDto.ruleId != null and itemPageDto.ruleId !=''">
                 and i.rule_id = #{itemPageDto.ruleId}
             </if>

+ 2 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppRuleMapper.xml

@@ -13,6 +13,7 @@
         from core_resumption_rule a
         inner join sys_org org on a.org_id = org.id
         <where>
+            a.deleted=0
             <if test="appRule.name != null and appRule.name != ''">
                 and a.name like CONCAT('%',#{appRule.name},'%')
             </if>
@@ -36,7 +37,7 @@
                r.org_type as orgTypeId
         from core_resumption_rule r
                  inner join sys_dict_data d on r.type = d.id and d.dict_code = 'sys_org_type'
-        where status = "0"
+        where status = "0" and r.deleted=0
     </select>
 
     <!--    <select id="get" resultType="com.xunmei.core.resumption.vo.appRule.AppRuleInfoVo">-->

+ 6 - 6
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppRulePointMapper.xml

@@ -77,7 +77,7 @@
         inner join sys_area a on p.area_id = a.id
         inner join sys_dict_detail d on d.code = p.safe_type and d.dict_code = 'check_type'
         inner join t_app_rule ap on p.rule_id =ap.id
-        where p.deleted = 0
+        where p.deleted = 0 and ri.deleted=0
         <if test="pointIds != null and pointIds.size > 0">
             and p.id in
             <foreach collection="pointIds" item="pointId" open="(" separator="," close=")">
@@ -104,7 +104,7 @@
     <select id="findAreaListPlan" parameterType="Long" resultType="java.util.Map">
         SELECT a.area_id as areaid, d.name as areaname
         from core_resumption_rule_point a
-                 LEFT JOIN core_resumption_plan_to_point b ON a.id = b.item_id
+                 LEFT JOIN core_resumption_plan_to_point b ON a.id = b.point_id
                  LEFT JOIN core_resumption_plan c ON b.plan_id = c.id
                  LEFT JOIN sys_area d ON a.area_id = d.id
         WHERE c.id = #{planid}
@@ -141,8 +141,8 @@
 
     <update id="updatePlanItem">
         update core_resumption_plan_to_point
-        set item_id=#{newId}
-        where item_id = #{id}
+        set point_id=#{newId}
+        where point_id = #{id}
     </update>
 
 <!--    <select id="checkPointNumRepeat" resultType="java.lang.Integer">-->
@@ -225,8 +225,8 @@
     </select>
     <select id="checkIsJoinResumptionPlan" resultType="java.lang.Integer">
         SELECT DISTINCT 1
-        FROM sys_plan_to_item
-        WHERE item_id in
+        FROM core_resumption_plan_to_point
+        WHERE point_id in
         <foreach collection="pointIds" item="pointId" index="index" open="(" separator="," close=")">
             #{pointId}
         </foreach>