13 changed files with 642 additions and 24 deletions
@ -0,0 +1,69 @@ |
|||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民死亡任务log |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-05-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiUserDeadTaskLogDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id customer.id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 0:正常数据 1:特殊数据 |
||||
|
*/ |
||||
|
private Integer dataType; |
||||
|
|
||||
|
/** |
||||
|
* 数据数量 |
||||
|
*/ |
||||
|
private Integer dataCount; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,72 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.dto.IcResiUserDeadTaskLogDTO; |
||||
|
import com.epmet.service.IcResiUserDeadTaskLogService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民死亡任务log |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-05-16 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icResiUserDeadTaskLog") |
||||
|
public class IcResiUserDeadTaskLogController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiUserDeadTaskLogService icResiUserDeadTaskLogService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<IcResiUserDeadTaskLogDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcResiUserDeadTaskLogDTO> page = icResiUserDeadTaskLogService.page(params); |
||||
|
return new Result<PageData<IcResiUserDeadTaskLogDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<IcResiUserDeadTaskLogDTO> get(@PathVariable("id") String id){ |
||||
|
IcResiUserDeadTaskLogDTO data = icResiUserDeadTaskLogService.get(id); |
||||
|
return new Result<IcResiUserDeadTaskLogDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody IcResiUserDeadTaskLogDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
icResiUserDeadTaskLogService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody IcResiUserDeadTaskLogDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
icResiUserDeadTaskLogService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("delete") |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
icResiUserDeadTaskLogService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcResiUserDeadTaskLogEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 居民死亡任务log |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-05-16 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcResiUserDeadTaskLogDao extends BaseDao<IcResiUserDeadTaskLogEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 居民死亡任务log |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-05-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_resi_user_dead_task_log") |
||||
|
public class IcResiUserDeadTaskLogEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id customer.id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 0:正常数据 1:特殊数据 |
||||
|
*/ |
||||
|
private Integer dataType; |
||||
|
|
||||
|
/** |
||||
|
* 数据数量 |
||||
|
*/ |
||||
|
private Integer dataCount; |
||||
|
|
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
package com.epmet.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 居民死亡任务log |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-05-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiUserDeadTaskLogExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "客户Id customer.id") |
||||
|
private String customerId; |
||||
|
|
||||
|
@Excel(name = "0:正常数据 1:特殊数据") |
||||
|
private Integer dataType; |
||||
|
|
||||
|
@Excel(name = "数据数量") |
||||
|
private Integer dataCount; |
||||
|
|
||||
|
@Excel(name = "删除标识 0.未删除 1.已删除") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 居民死亡任务log |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-05-16 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class IcResiUserDeadTaskLogRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,78 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.IcResiUserDeadTaskLogDTO; |
||||
|
import com.epmet.entity.IcResiUserDeadTaskLogEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 居民死亡任务log |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-05-16 |
||||
|
*/ |
||||
|
public interface IcResiUserDeadTaskLogService extends BaseService<IcResiUserDeadTaskLogEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcResiUserDeadTaskLogDTO> |
||||
|
* @author generator |
||||
|
* @date 2023-05-16 |
||||
|
*/ |
||||
|
PageData<IcResiUserDeadTaskLogDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcResiUserDeadTaskLogDTO> |
||||
|
* @author generator |
||||
|
* @date 2023-05-16 |
||||
|
*/ |
||||
|
List<IcResiUserDeadTaskLogDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return IcResiUserDeadTaskLogDTO |
||||
|
* @author generator |
||||
|
* @date 2023-05-16 |
||||
|
*/ |
||||
|
IcResiUserDeadTaskLogDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2023-05-16 |
||||
|
*/ |
||||
|
void save(IcResiUserDeadTaskLogDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2023-05-16 |
||||
|
*/ |
||||
|
void update(IcResiUserDeadTaskLogDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2023-05-16 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
@ -0,0 +1,83 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.dao.IcResiUserDeadTaskLogDao; |
||||
|
import com.epmet.dto.IcResiUserDeadTaskLogDTO; |
||||
|
import com.epmet.entity.IcResiUserDeadTaskLogEntity; |
||||
|
import com.epmet.service.IcResiUserDeadTaskLogService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 居民死亡任务log |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2023-05-16 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcResiUserDeadTaskLogServiceImpl extends BaseServiceImpl<IcResiUserDeadTaskLogDao, IcResiUserDeadTaskLogEntity> implements IcResiUserDeadTaskLogService { |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcResiUserDeadTaskLogDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcResiUserDeadTaskLogEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcResiUserDeadTaskLogDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcResiUserDeadTaskLogDTO> list(Map<String, Object> params) { |
||||
|
List<IcResiUserDeadTaskLogEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcResiUserDeadTaskLogDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcResiUserDeadTaskLogEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcResiUserDeadTaskLogEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public IcResiUserDeadTaskLogDTO get(String id) { |
||||
|
IcResiUserDeadTaskLogEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, IcResiUserDeadTaskLogDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcResiUserDeadTaskLogDTO dto) { |
||||
|
IcResiUserDeadTaskLogEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserDeadTaskLogEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(IcResiUserDeadTaskLogDTO dto) { |
||||
|
IcResiUserDeadTaskLogEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserDeadTaskLogEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
<?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.epmet.dao.IcResiUserDeadTaskLogDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcResiUserDeadTaskLogEntity" id="icResiUserDeadTaskLogMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="dataType" column="DATA_TYPE"/> |
||||
|
<result property="dataCount" column="DATA_COUNT"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue