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)
@GetMapping("/removeId/{troubleId}")
public Result<?> remove(@PathVariable Long troubleId) {
troubleService.removeById(troubleId);
public Result<?> remove(@PathVariable Integer troubleId) {
troubleService.delByTroubleId(troubleId);
return success();
}
}

View File

@ -1,5 +1,8 @@
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.web.domain.BaseEntity;
import lombok.*;
@ -13,14 +16,15 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @date 2024/3/26 21:49
* @description
*/
@Getter
//@Getter
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
//@EqualsAndHashCode(callSuper = true)
@TableName("trouble")
public class Trouble extends BaseEntity {
private static final long serialVersionUID = 1L;
// private static final long serialVersionUID = 1L;
/**
* id
@ -62,44 +66,44 @@ public class Trouble extends BaseEntity {
*/
private Integer troubleGradeId;
public void setTroubleId (Integer troubleId) {
this.troubleId = troubleId;
}
public void setTroubleCode (String troubleCode) {
this.troubleCode = troubleCode;
}
public void setTroublePosition (String troublePosition) {
this.troublePosition = troublePosition;
}
public void setTroubleValue (String troubleValue) {
this.troubleValue = troubleValue;
}
public void setTroubleTag (String troubleTag) {
this.troubleTag = troubleTag;
}
public void setTroubleTypeId (Integer troubleTypeId) {
this.troubleTypeId = troubleTypeId;
}
public void setTroubleGradeId (Integer troubleGradeId) {
this.troubleGradeId = troubleGradeId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("troubleId", getTroubleId())
.append("troubleCode", getTroubleCode())
.append("troublePosition", getTroublePosition())
.append("troubleValue", getTroubleValue())
.append("troubleTag", getTroubleTag())
.append("troubleTypeId", getTroubleTypeId())
.append("troubleGradeId", getTroubleGradeId())
.toString();
}
// public void setTroubleId (Integer troubleId) {
// this.troubleId = troubleId;
// }
//
// public void setTroubleCode (String troubleCode) {
// this.troubleCode = troubleCode;
// }
//
// public void setTroublePosition (String troublePosition) {
// this.troublePosition = troublePosition;
// }
//
// public void setTroubleValue (String troubleValue) {
// this.troubleValue = troubleValue;
// }
//
// public void setTroubleTag (String troubleTag) {
// this.troubleTag = troubleTag;
// }
//
// public void setTroubleTypeId (Integer troubleTypeId) {
// this.troubleTypeId = troubleTypeId;
// }
//
// public void setTroubleGradeId (Integer troubleGradeId) {
// this.troubleGradeId = troubleGradeId;
// }
//
// @Override
// public String toString() {
// return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
// .append("troubleId", getTroubleId())
// .append("troubleCode", getTroubleCode())
// .append("troublePosition", getTroublePosition())
// .append("troubleValue", getTroubleValue())
// .append("troubleTag", getTroubleTag())
// .append("troubleTypeId", getTroubleTypeId())
// .append("troubleGradeId", getTroubleGradeId())
// .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.TroubleUpdReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -21,4 +22,6 @@ public interface SysTroubleMapper extends BaseMapper<Trouble> {
int addTrouble(TroubleAddReq troubleAddReq);
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.req.TroubleAddReq;
import com.couplet.trouble.domain.req.TroubleUpdReq;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -20,5 +21,5 @@ public interface SysTroubleService extends IService<Trouble> {
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);
}
@Override
public int delByTroubleId(Integer troubleId) {
return sysTroubleMapper.delByTroubleId(troubleId);
}
}

View File

@ -68,10 +68,13 @@
from dxd_trouble_code
where dict_code = #{dictCode}
</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(-->
<!-- <if test="troubleCode != null and troubleCode != ''">trouble_code,</if>-->
<!-- <if test="troublePosition != null and troublePosition != ''">trouble_position,</if>-->