server_five_liuyunhu
dongxiaodong 2024-03-28 14:28:45 +08:00
parent 3be43f8fb6
commit 69c67fbcad
6 changed files with 64 additions and 48 deletions

View File

@ -61,8 +61,8 @@ public class SysTroubleController extends BaseController {
*/ */
@Log(title = "删除故障码",businessType = BusinessType.DELETE) @Log(title = "删除故障码",businessType = BusinessType.DELETE)
@GetMapping("/removeId/{troubleId}") @GetMapping("/removeId/{troubleId}")
public Result<?> remove(@PathVariable Long troubleId) { public Result<?> remove(@PathVariable Integer troubleId) {
troubleService.removeById(troubleId); troubleService.delByTroubleId(troubleId);
return success(); return success();
} }
} }

View File

@ -1,5 +1,8 @@
package com.couplet.trouble.domain; package com.couplet.trouble.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.couplet.common.core.annotation.Excel; import com.couplet.common.core.annotation.Excel;
import com.couplet.common.core.web.domain.BaseEntity; import com.couplet.common.core.web.domain.BaseEntity;
import lombok.*; import lombok.*;
@ -13,14 +16,15 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @date 2024/3/26 21:49 * @date 2024/3/26 21:49
* @description * @description
*/ */
@Getter //@Getter
@Data @Data
@SuperBuilder @SuperBuilder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@EqualsAndHashCode(callSuper = true) //@EqualsAndHashCode(callSuper = true)
@TableName("trouble")
public class Trouble extends BaseEntity { public class Trouble extends BaseEntity {
private static final long serialVersionUID = 1L; // private static final long serialVersionUID = 1L;
/** /**
* id * id
@ -62,44 +66,44 @@ public class Trouble extends BaseEntity {
*/ */
private Integer troubleGradeId; private Integer troubleGradeId;
public void setTroubleId (Integer troubleId) { // public void setTroubleId (Integer troubleId) {
this.troubleId = troubleId; // this.troubleId = troubleId;
} // }
//
public void setTroubleCode (String troubleCode) { // public void setTroubleCode (String troubleCode) {
this.troubleCode = troubleCode; // this.troubleCode = troubleCode;
} // }
//
public void setTroublePosition (String troublePosition) { // public void setTroublePosition (String troublePosition) {
this.troublePosition = troublePosition; // this.troublePosition = troublePosition;
} // }
//
public void setTroubleValue (String troubleValue) { // public void setTroubleValue (String troubleValue) {
this.troubleValue = troubleValue; // this.troubleValue = troubleValue;
} // }
//
public void setTroubleTag (String troubleTag) { // public void setTroubleTag (String troubleTag) {
this.troubleTag = troubleTag; // this.troubleTag = troubleTag;
} // }
//
public void setTroubleTypeId (Integer troubleTypeId) { // public void setTroubleTypeId (Integer troubleTypeId) {
this.troubleTypeId = troubleTypeId; // this.troubleTypeId = troubleTypeId;
} // }
//
public void setTroubleGradeId (Integer troubleGradeId) { // public void setTroubleGradeId (Integer troubleGradeId) {
this.troubleGradeId = troubleGradeId; // this.troubleGradeId = troubleGradeId;
} // }
//
@Override // @Override
public String toString() { // public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) // return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("troubleId", getTroubleId()) // .append("troubleId", getTroubleId())
.append("troubleCode", getTroubleCode()) // .append("troubleCode", getTroubleCode())
.append("troublePosition", getTroublePosition()) // .append("troublePosition", getTroublePosition())
.append("troubleValue", getTroubleValue()) // .append("troubleValue", getTroubleValue())
.append("troubleTag", getTroubleTag()) // .append("troubleTag", getTroubleTag())
.append("troubleTypeId", getTroubleTypeId()) // .append("troubleTypeId", getTroubleTypeId())
.append("troubleGradeId", getTroubleGradeId()) // .append("troubleGradeId", getTroubleGradeId())
.toString(); // .toString();
} // }
} }

View File

@ -5,6 +5,7 @@ import com.couplet.trouble.domain.Trouble;
import com.couplet.trouble.domain.req.TroubleAddReq; import com.couplet.trouble.domain.req.TroubleAddReq;
import com.couplet.trouble.domain.req.TroubleUpdReq; import com.couplet.trouble.domain.req.TroubleUpdReq;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -21,4 +22,6 @@ public interface SysTroubleMapper extends BaseMapper<Trouble> {
int addTrouble(TroubleAddReq troubleAddReq); int addTrouble(TroubleAddReq troubleAddReq);
int updateTrouble(TroubleUpdReq troubleUpdReq); int updateTrouble(TroubleUpdReq troubleUpdReq);
int delByTroubleId(@Param("troubleId") Integer troubleId);
} }

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.couplet.trouble.domain.Trouble; import com.couplet.trouble.domain.Trouble;
import com.couplet.trouble.domain.req.TroubleAddReq; import com.couplet.trouble.domain.req.TroubleAddReq;
import com.couplet.trouble.domain.req.TroubleUpdReq; import com.couplet.trouble.domain.req.TroubleUpdReq;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -20,5 +21,5 @@ public interface SysTroubleService extends IService<Trouble> {
int updateTrouble(TroubleUpdReq troubleUpdReq); int updateTrouble(TroubleUpdReq troubleUpdReq);
int delByTroubleId(Integer troubleId);
} }

View File

@ -53,5 +53,10 @@ public class SysTroubleServiceImpl extends ServiceImpl<SysTroubleMapper, Trouble
return sysTroubleMapper.updateTrouble(troubleUpdReq); return sysTroubleMapper.updateTrouble(troubleUpdReq);
} }
@Override
public int delByTroubleId(Integer troubleId) {
return sysTroubleMapper.delByTroubleId(troubleId);
}
} }

View File

@ -68,10 +68,13 @@
from dxd_trouble_code from dxd_trouble_code
where dict_code = #{dictCode} where dict_code = #{dictCode}
</delete> </delete>
<delete id="delByTroubleId">
delete from dxd_trouble_code
where trouble_id =#{troubleId}
</delete>
<!-- <insert id="addTrouble" parameterType="com.couplet.trouble.domain.req.TroubleAddReq">-->
<!-- <insert id="addTrouble" parameterType="com.couplet.trouble.domain.req.TroubleAddReq">-->
<!-- insert into dxd_trouble_code(--> <!-- insert into dxd_trouble_code(-->
<!-- <if test="troubleCode != null and troubleCode != ''">trouble_code,</if>--> <!-- <if test="troubleCode != null and troubleCode != ''">trouble_code,</if>-->
<!-- <if test="troublePosition != null and troublePosition != ''">trouble_position,</if>--> <!-- <if test="troublePosition != null and troublePosition != ''">trouble_position,</if>-->