慢性病去掉id
This commit is contained in:
parent
bd161823f9
commit
0ad1b05338
|
|
@ -10,9 +10,6 @@ import java.time.LocalDateTime;
|
||||||
@TableName("health_chronic")
|
@TableName("health_chronic")
|
||||||
@ApiModel("慢性病基础表")
|
@ApiModel("慢性病基础表")
|
||||||
public class HealthChronic {
|
public class HealthChronic {
|
||||||
@TableId
|
|
||||||
@ApiModelProperty("主键")
|
|
||||||
private Long id;
|
|
||||||
@ApiModelProperty("慢性病id")
|
@ApiModelProperty("慢性病id")
|
||||||
private Long chronicId;
|
private Long chronicId;
|
||||||
@ApiModelProperty("慢性病名称")
|
@ApiModelProperty("慢性病名称")
|
||||||
|
|
@ -35,10 +32,6 @@ public class HealthChronic {
|
||||||
return new HealthChronicBuilder();
|
return new HealthChronicBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getChronicId() {
|
public Long getChronicId() {
|
||||||
return this.chronicId;
|
return this.chronicId;
|
||||||
}
|
}
|
||||||
|
|
@ -67,10 +60,6 @@ public class HealthChronic {
|
||||||
return this.updateTime;
|
return this.updateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(final Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setChronicId(final Long chronicId) {
|
public void setChronicId(final Long chronicId) {
|
||||||
this.chronicId = chronicId;
|
this.chronicId = chronicId;
|
||||||
}
|
}
|
||||||
|
|
@ -100,10 +89,9 @@ public class HealthChronic {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public HealthChronic(final Long id, final Long chronicId, final String chronicName,
|
public HealthChronic(final Long chronicId, final String chronicName,
|
||||||
final Integer delFlag, final String createBy, final LocalDateTime createTime,
|
final Integer delFlag, final String createBy, final LocalDateTime createTime,
|
||||||
final String updateBy, final LocalDateTime updateTime) {
|
final String updateBy, final LocalDateTime updateTime) {
|
||||||
this.id = id;
|
|
||||||
this.chronicId = chronicId;
|
this.chronicId = chronicId;
|
||||||
this.chronicName = chronicName;
|
this.chronicName = chronicName;
|
||||||
this.delFlag = delFlag;
|
this.delFlag = delFlag;
|
||||||
|
|
@ -114,7 +102,6 @@ public class HealthChronic {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HealthChronicBuilder {
|
public static class HealthChronicBuilder {
|
||||||
private Long id;
|
|
||||||
private Long chronicId;
|
private Long chronicId;
|
||||||
private String chronicName;
|
private String chronicName;
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
@ -126,11 +113,6 @@ public class HealthChronic {
|
||||||
HealthChronicBuilder() {
|
HealthChronicBuilder() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public HealthChronicBuilder id(final Long id) {
|
|
||||||
this.id = id;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HealthChronicBuilder chronicId(final Long chronicId) {
|
public HealthChronicBuilder chronicId(final Long chronicId) {
|
||||||
this.chronicId = chronicId;
|
this.chronicId = chronicId;
|
||||||
return this;
|
return this;
|
||||||
|
|
@ -167,7 +149,7 @@ public class HealthChronic {
|
||||||
}
|
}
|
||||||
|
|
||||||
public HealthChronic build() {
|
public HealthChronic build() {
|
||||||
return new HealthChronic(this.id, this.chronicId, this.chronicName, this.delFlag, this.createBy, this.createTime, this.updateBy, this.updateTime);
|
return new HealthChronic(this.chronicId, this.chronicName, this.delFlag, this.createBy, this.createTime, this.updateBy, this.updateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,9 +68,9 @@ public class HealthChronicController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取慢性病详细信息")
|
@ApiOperation(value = "获取慢性病详细信息")
|
||||||
//@RequiresPermissions("nutrition:chronic:query")
|
//@RequiresPermissions("nutrition:chronic:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{chronicId}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
public AjaxResult getInfo(@PathVariable("chronicId") Long chronicId) {
|
||||||
return success(healthChronicService.selectHealthChronicById(id));
|
return success(healthChronicService.selectHealthChronicById(chronicId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -112,8 +112,8 @@ public class HealthChronicController extends BaseController {
|
||||||
//@PreventRepeatSubmit
|
//@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("nutrition:chronic:remove")
|
//@RequiresPermissions("nutrition:chronic:remove")
|
||||||
@SysLog(title = "慢性病", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除慢性病")
|
@SysLog(title = "慢性病", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除慢性病")
|
||||||
@PostMapping("/del/{ids}")
|
@PostMapping("/del/{chronicIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@PathVariable Long[] chronicIds) {
|
||||||
return toAjax(healthChronicService.deleteHealthChronicByIds(ids));
|
return toAjax(healthChronicService.deleteHealthChronicByIds(chronicIds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,6 @@ import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
public class HealthChronic extends BaseEntity {
|
public class HealthChronic extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 主键 */
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/** 慢性病id */
|
/** 慢性病id */
|
||||||
@Excel(name = "慢性病id")
|
@Excel(name = "慢性病id")
|
||||||
@ApiModelProperty(value = "慢性病id")
|
@ApiModelProperty(value = "慢性病id")
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,10 @@ public interface HealthChronicMapper {
|
||||||
/**
|
/**
|
||||||
* 查询慢性病
|
* 查询慢性病
|
||||||
*
|
*
|
||||||
* @param id 慢性病主键
|
* @param chronicId 慢性病主键
|
||||||
* @return 慢性病
|
* @return 慢性病
|
||||||
*/
|
*/
|
||||||
public HealthChronic selectHealthChronicById(Long id);
|
public HealthChronic selectHealthChronicById(Long chronicId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询慢性病列表
|
* 查询慢性病列表
|
||||||
|
|
@ -45,16 +45,16 @@ public interface HealthChronicMapper {
|
||||||
/**
|
/**
|
||||||
* 删除慢性病
|
* 删除慢性病
|
||||||
*
|
*
|
||||||
* @param id 慢性病主键
|
* @param chronicId 慢性病主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteHealthChronicById(Long id);
|
public int deleteHealthChronicById(Long chronicId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除慢性病
|
* 批量删除慢性病
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param chronicIds 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteHealthChronicByIds(Long[] ids);
|
public int deleteHealthChronicByIds(Long[] chronicIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,10 @@ public interface IHealthChronicService {
|
||||||
/**
|
/**
|
||||||
* 查询慢性病
|
* 查询慢性病
|
||||||
*
|
*
|
||||||
* @param id 慢性病主键
|
* @param chronicId 慢性病主键
|
||||||
* @return 慢性病
|
* @return 慢性病
|
||||||
*/
|
*/
|
||||||
public HealthChronic selectHealthChronicById(Long id);
|
public HealthChronic selectHealthChronicById(Long chronicId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询慢性病列表
|
* 查询慢性病列表
|
||||||
|
|
@ -45,16 +45,16 @@ public interface IHealthChronicService {
|
||||||
/**
|
/**
|
||||||
* 批量删除慢性病
|
* 批量删除慢性病
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的慢性病主键集合
|
* @param chronicIdss 需要删除的慢性病主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteHealthChronicByIds(Long[] ids);
|
public int deleteHealthChronicByIds(Long[] chronicIdss);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除慢性病信息
|
* 删除慢性病信息
|
||||||
*
|
*
|
||||||
* @param id 慢性病主键
|
* @param chronicId 慢性病主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteHealthChronicById(Long id);
|
public int deleteHealthChronicById(Long chronicId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,12 @@ public class HealthChronicServiceImpl implements IHealthChronicService {
|
||||||
/**
|
/**
|
||||||
* 查询慢性病
|
* 查询慢性病
|
||||||
*
|
*
|
||||||
* @param id 慢性病主键
|
* @param chronicId 慢性病主键
|
||||||
* @return 慢性病
|
* @return 慢性病
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public HealthChronic selectHealthChronicById(Long id) {
|
public HealthChronic selectHealthChronicById(Long chronicId) {
|
||||||
return healthChronicMapper.selectHealthChronicById(id);
|
return healthChronicMapper.selectHealthChronicById(chronicId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -82,22 +82,22 @@ public class HealthChronicServiceImpl implements IHealthChronicService {
|
||||||
/**
|
/**
|
||||||
* 批量删除慢性病
|
* 批量删除慢性病
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的慢性病主键
|
* @param chronicIds 需要删除的慢性病主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteHealthChronicByIds(Long[] ids) {
|
public int deleteHealthChronicByIds(Long[] chronicIds) {
|
||||||
return healthChronicMapper.deleteHealthChronicByIds(ids);
|
return healthChronicMapper.deleteHealthChronicByIds(chronicIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除慢性病信息
|
* 删除慢性病信息
|
||||||
*
|
*
|
||||||
* @param id 慢性病主键
|
* @param chronicId 慢性病主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteHealthChronicById(Long id) {
|
public int deleteHealthChronicById(Long chronicId) {
|
||||||
return healthChronicMapper.deleteHealthChronicById(id);
|
return healthChronicMapper.deleteHealthChronicById(chronicId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.canteen.core.nutrition.mapper.HealthChronicMapper">
|
<mapper namespace="com.bonus.canteen.core.nutrition.mapper.HealthChronicMapper">
|
||||||
<resultMap type="com.bonus.canteen.core.nutrition.domain.HealthChronic" id="HealthChronicResult">
|
<resultMap type="com.bonus.canteen.core.nutrition.domain.HealthChronic" id="HealthChronicResult">
|
||||||
<result property="id" column="id" />
|
|
||||||
<result property="chronicId" column="chronic_id" />
|
<result property="chronicId" column="chronic_id" />
|
||||||
<result property="chronicName" column="chronic_name" />
|
<result property="chronicName" column="chronic_name" />
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag" />
|
||||||
|
|
@ -16,7 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectHealthChronicVo">
|
<sql id="selectHealthChronicVo">
|
||||||
select id, chronic_id, chronic_name, del_flag, create_by, create_time, update_by, update_time, remark from health_chronic
|
select chronic_id, chronic_name, del_flag, create_by, create_time, update_by, update_time, remark from health_chronic
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectHealthChronicList" parameterType="com.bonus.canteen.core.nutrition.domain.HealthChronic" resultMap="HealthChronicResult">
|
<select id="selectHealthChronicList" parameterType="com.bonus.canteen.core.nutrition.domain.HealthChronic" resultMap="HealthChronicResult">
|
||||||
|
|
@ -29,13 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectHealthChronicById" parameterType="Long" resultMap="HealthChronicResult">
|
<select id="selectHealthChronicById" parameterType="Long" resultMap="HealthChronicResult">
|
||||||
<include refid="selectHealthChronicVo"/>
|
<include refid="selectHealthChronicVo"/>
|
||||||
where id = #{id}
|
where chronic_id = #{chronicId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertHealthChronic" parameterType="com.bonus.canteen.core.nutrition.domain.HealthChronic" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertHealthChronic" parameterType="com.bonus.canteen.core.nutrition.domain.HealthChronic" useGeneratedKeys="true" keyProperty="chronicId">
|
||||||
insert into health_chronic
|
insert into health_chronic
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="chronicId != null">chronic_id,</if>
|
|
||||||
<if test="chronicName != null and chronicName != ''">chronic_name,</if>
|
<if test="chronicName != null and chronicName != ''">chronic_name,</if>
|
||||||
<if test="delFlag != null">del_flag,</if>
|
<if test="delFlag != null">del_flag,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
|
|
@ -45,7 +43,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="chronicId != null">#{chronicId},</if>
|
|
||||||
<if test="chronicName != null and chronicName != ''">#{chronicName},</if>
|
<if test="chronicName != null and chronicName != ''">#{chronicName},</if>
|
||||||
<if test="delFlag != null">#{delFlag},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
|
@ -68,17 +65,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where chronic_id = #{chronicId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteHealthChronicById" parameterType="Long">
|
<delete id="deleteHealthChronicById" parameterType="Long">
|
||||||
delete from health_chronic where id = #{id}
|
delete from health_chronic where chronic_id = #{chronicId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteHealthChronicByIds" parameterType="String">
|
<delete id="deleteHealthChronicByIds" parameterType="String">
|
||||||
delete from health_chronic where id in
|
delete from health_chronic where chronic_id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="chronicId" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{chronicId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue