e0c9026f 张雷

feat(report): 新增经营目标拆分功能

- 添加 ReportTargetConfigSub 实体类
- 创建 IReportTargetConfigSubService 接口及实现类
- 开发 ReportTargetConfigSubController 控制器- 编写 ReportTargetConfigSubMapper 接口及 XML 文件- 在 ReportTargetConfig 中添加费用目标字段
1 个父辈 c8b2a72d
......@@ -36,6 +36,10 @@ public class ReportTargetConfig {
@Excel(name = "水量目标", width = 15)
@ApiModelProperty(value = "水量目标")
private String targetWater;
/**费用目标*/
@Excel(name = "费用目标", width = 15)
@ApiModelProperty(value = "费用目标")
private String targetCost;
/**电量目标*/
@Excel(name = "电量目标", width = 15)
@ApiModelProperty(value = "电量目标")
......
package com.skua.modules.report.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 经营目标拆分
*/
@Data
@TableName("report_target_config_sub")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="report_target_config_sub对象", description="经营目标拆分")
public class ReportTargetConfigSub {
/**主键id*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键id")
private String id;
/**所属厂区*/
@Excel(name = "所属厂区", width = 15)
@ApiModelProperty(value = "所属厂区")
private String departId;
/**目标时间*/
@Excel(name = "目标时间", width = 15)
@ApiModelProperty(value = "目标时间")
private String targetTime;
/**目标类型*/
@Excel(name = "目标类型", width = 15)
@ApiModelProperty(value = "目标类型")
private String targetType;
/**目标值*/
@Excel(name = "目标值", width = 15)
@ApiModelProperty(value = "目标值")
private String targetValue;
/**创建人Id*/
@Excel(name = "创建人Id", width = 15)
@ApiModelProperty(value = "创建人Id")
private String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**修改人Id*/
@Excel(name = "修改人Id", width = 15)
@ApiModelProperty(value = "修改人Id")
private String updateBy;
/**修改时间*/
@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**删除标识*/
@Excel(name = "删除标识", width = 15)
@ApiModelProperty(value = "删除标识")
private Integer delFlag;
}
package com.skua.modules.report.mapper;
import com.skua.tool.annotation.Anonymous;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.report.entity.ReportTargetConfigSub;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* 经营目标拆分
*/
public interface ReportTargetConfigSubMapper extends BaseMapper<ReportTargetConfigSub> {
void batchDeleteData(@Param("departId") String departId, @Param("year") String year, @Param("type") String type);
@Anonymous
List<ReportTargetConfigSub> getList(@Param("departId") String departId, @Param("year") String year, @Param("targetType") String targetType);
}
<?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.skua.modules.report.mapper.ReportTargetConfigSubMapper">
<delete id="batchDeleteData">
DELETE FROM report_target_config_sub
WHERE depart_id = #{departId} AND target_type = #{type} AND target_time like concat(#{year},'%')
</delete>
<select id="getList" resultType="com.skua.modules.report.entity.ReportTargetConfigSub">
SELECT * FROM report_target_config_sub
WHERE depart_id = #{departId} AND target_type = #{targetType} AND target_time like concat(#{year},'%')
</select>
</mapper>
package com.skua.modules.report.service;
import com.skua.modules.report.entity.ReportTargetConfigSub;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.tool.annotation.Anonymous;
import java.util.List;
/**
* 经营目标拆分
*/
public interface IReportTargetConfigSubService extends IService<ReportTargetConfigSub> {
boolean batchDeleteData(String departId, String year, String type);
List<ReportTargetConfigSub> getList(ReportTargetConfigSub reportTargetConfigSub);
}
package com.skua.modules.report.service.impl;
import com.skua.modules.report.entity.ReportTargetConfigSub;
import com.skua.modules.report.mapper.ReportTargetConfigSubMapper;
import com.skua.modules.report.service.IReportTargetConfigSubService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Collections;
import java.util.List;
/**
* 经营目标拆分
*/
@Service
public class ReportTargetConfigSubServiceImpl extends ServiceImpl<ReportTargetConfigSubMapper, ReportTargetConfigSub> implements IReportTargetConfigSubService {
@Autowired
ReportTargetConfigSubMapper reportTargetSubMapper;
@Override
public boolean batchDeleteData(String departId, String year, String type) {
reportTargetSubMapper.batchDeleteData(departId,year,type);
return true;
}
@Override
public List<ReportTargetConfigSub> getList(ReportTargetConfigSub reportTargetConfigSub) {
return reportTargetSubMapper.getList(reportTargetConfigSub.getDepartId(), reportTargetConfigSub.getTargetTime(),
reportTargetConfigSub.getTargetType());
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!