
12 changed files with 220 additions and 22 deletions
@ -1,19 +1,33 @@ |
|||||
package com.supervise.rms.api.risklevel; |
package com.supervise.rms.api.risklevel; |
||||
|
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.yxt.common.core.domain.BaseEntity; |
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModel; |
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.UUID; |
||||
|
|
||||
@Data |
@Data |
||||
@ApiModel(value = "风险等级表", description = "风险名单表") |
@ApiModel(value = "风险等级表", description = "风险名单表") |
||||
@TableName("risk_level") |
@TableName("risk_level") |
||||
public class RiskLevel extends BaseEntity { |
public class RiskLevel { |
||||
|
@ApiModelProperty("ID,唯一编号") |
||||
|
private Integer id; |
||||
|
@ApiModelProperty("字符型编号") |
||||
|
private String sid = UUID.randomUUID().toString(); |
||||
|
@ApiModelProperty("记录创建时间") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
||||
|
private Date createTime = new Date(); |
||||
@ApiModelProperty("风险等级名称") |
@ApiModelProperty("风险等级名称") |
||||
private String riskLevelName; |
private String name; |
||||
@ApiModelProperty("风险等级代码") |
@ApiModelProperty("风险等级代码") |
||||
private String riskLevelCode; |
private String code; |
||||
@ApiModelProperty("风险程度Sid") |
@ApiModelProperty("处理方式") |
||||
private String riskDegreeSid; |
private String handlingMethod; |
||||
|
@ApiModelProperty("报送单位") |
||||
|
private Integer reportTarget; |
||||
|
@ApiModelProperty("备注信息") |
||||
|
private String remarks; |
||||
} |
} |
||||
|
@ -0,0 +1,17 @@ |
|||||
|
package com.supervise.rms.api.risklevel; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-16-9:31 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RiskLevelQuery implements Query { |
||||
|
@ApiModelProperty("风险等级名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty("风险等级代码") |
||||
|
private String code; |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.supervise.rms.biz.risktype; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.supervise.rms.api.risktype.RiskType; |
||||
|
import com.supervise.rms.api.risktype.RiskTypeVo; |
||||
|
import org.apache.ibatis.annotations.Delete; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-14-16:18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface RiskTypeMapper extends BaseMapper<RiskType> { |
||||
|
|
||||
|
IPage<RiskTypeVo> listPage(IPage<RiskType> page, @Param(Constants.WRAPPER) Wrapper<RiskType> qw); |
||||
|
|
||||
|
List<RiskType> selectRiskTypeFirst(); |
||||
|
|
||||
|
List<RiskType> selectRiskTypeSubordinate(@Param("sid") String sid); |
||||
|
|
||||
|
@Delete("delete from risk_type where parentSid = #{parentSid}") |
||||
|
void del(@Param("parentSid") String parentSid); |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.supervise.rms.biz.risktype.RiskTypeMapper"> |
||||
|
|
||||
|
<select id="listPage" resultType="com.supervise.rms.api.risktype.RiskTypeVo"> |
||||
|
select * from risk_type |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectRiskTypeFirst" resultType="com.supervise.rms.api.risktype.RiskType"> |
||||
|
select * from risk_type where hierarchy = 1 |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectRiskTypeSubordinate" resultType="com.supervise.rms.api.risktype.RiskType"> |
||||
|
select * from risk_type where parentSid = #{sid} |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,57 @@ |
|||||
|
package com.supervise.rms.biz.risktype; |
||||
|
|
||||
|
import com.supervise.rms.api.risktype.RiskTypeDto; |
||||
|
import com.supervise.rms.api.risktype.RiskTypeQuery; |
||||
|
import com.supervise.rms.api.risktype.RiskTypeVo; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @author feikefei |
||||
|
* @create 2023-06-14-16:14 |
||||
|
*/ |
||||
|
@Api(tags = "风险类别表") |
||||
|
@RestController("com.supervise.rmc.biz.risktype.RiskType") |
||||
|
@RequestMapping("v1/riskType") |
||||
|
public class RiskTypeRest { |
||||
|
|
||||
|
@Autowired |
||||
|
private RiskTypeService riskTypeService; |
||||
|
|
||||
|
@ApiOperation("保存风险类别") |
||||
|
@PostMapping("/saveRiskType") |
||||
|
public ResultBean saveRiskType(@RequestBody RiskTypeDto dto){ |
||||
|
return riskTypeService.saveRiskType(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("分页查询") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean listPage(@RequestBody PagerQuery<RiskTypeQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<RiskTypeVo> pagerVo = riskTypeService.listPage(pq); |
||||
|
return rb.success().setData(pagerVo); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("查询所有一级风险类别") |
||||
|
@GetMapping("/selectRiskTypeFirst") |
||||
|
public ResultBean selectRiskTypeFirst(){ |
||||
|
return riskTypeService.selectRiskTypeFirst(); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("查询所有一级下的风险类别") |
||||
|
@GetMapping("/selectRiskTypeSubordinate/{sid}") |
||||
|
public ResultBean selectRiskTypeSubordinate(@PathVariable String sid){ |
||||
|
return riskTypeService.selectRiskTypeSubordinate(sid); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("删除一级下的风险类别") |
||||
|
@GetMapping("/del/{sid}") |
||||
|
public ResultBean del(@PathVariable String sid){ |
||||
|
return riskTypeService.del(sid); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue