8 changed files with 0 additions and 757 deletions
@ -1,111 +0,0 @@ |
|||||
package com.zdxt.enforcementcode.domain.bean; |
|
||||
|
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|
||||
import com.baomidou.mybatisplus.annotation.*; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
import java.io.Serial; |
|
||||
|
|
||||
/** |
|
||||
* 趋势行为分析-区域统计对象 dashboard_trend_area_stat |
|
||||
* |
|
||||
* @author Lion Li |
|
||||
* @date 2026-05-27 |
|
||||
*/ |
|
||||
@Data |
|
||||
@EqualsAndHashCode(callSuper = true) |
|
||||
@TableName("dashboard_trend_area_stat") |
|
||||
public class DashboardTrendAreaStat extends BaseEntity { |
|
||||
|
|
||||
@Serial |
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** |
|
||||
* 主键ID |
|
||||
*/ |
|
||||
@TableId(value = "id") |
|
||||
private String id; |
|
||||
|
|
||||
/** |
|
||||
* 年份 |
|
||||
*/ |
|
||||
private Long year; |
|
||||
|
|
||||
/** |
|
||||
* 季度:1-一季度 2-二季度 3-三季度 4-四季度 |
|
||||
*/ |
|
||||
private Long quarter; |
|
||||
|
|
||||
/** |
|
||||
* 区编码 |
|
||||
*/ |
|
||||
private String districtCode; |
|
||||
|
|
||||
/** |
|
||||
* 区名称 |
|
||||
*/ |
|
||||
private String districtName; |
|
||||
|
|
||||
/** |
|
||||
* 检查次数 |
|
||||
*/ |
|
||||
private Long jccs; |
|
||||
|
|
||||
/** |
|
||||
* 评级A+数量 |
|
||||
*/ |
|
||||
private Long djAPlus; |
|
||||
|
|
||||
/** |
|
||||
* 评级A数量 |
|
||||
*/ |
|
||||
private Long djA; |
|
||||
|
|
||||
/** |
|
||||
* 评级B数量 |
|
||||
*/ |
|
||||
private Long djB; |
|
||||
|
|
||||
/** |
|
||||
* 评级C数量 |
|
||||
*/ |
|
||||
private Long djC; |
|
||||
|
|
||||
/** |
|
||||
* 评级D数量 |
|
||||
*/ |
|
||||
private Long djD; |
|
||||
|
|
||||
/** |
|
||||
* 评级E数量 |
|
||||
*/ |
|
||||
private Long djE; |
|
||||
|
|
||||
/** |
|
||||
* 违规次数 |
|
||||
*/ |
|
||||
private Long wgcs; |
|
||||
|
|
||||
/** |
|
||||
* 逻辑删除:0-否 1-是 |
|
||||
*/ |
|
||||
private String isDelete; |
|
||||
|
|
||||
/** |
|
||||
* 执法单位ID |
|
||||
*/ |
|
||||
private String bureauDeptId; |
|
||||
|
|
||||
/** |
|
||||
* 部门ID |
|
||||
*/ |
|
||||
private String deptId; |
|
||||
|
|
||||
/** |
|
||||
* 组织单位ID |
|
||||
*/ |
|
||||
private String organId; |
|
||||
|
|
||||
|
|
||||
} |
|
||||
@ -1,113 +0,0 @@ |
|||||
package com.zdxt.enforcementcode.domain.bo; |
|
||||
|
|
||||
|
|
||||
import com.zdxt.enforcementcode.domain.bean.DashboardTrendAreaStat; |
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|
||||
import org.dromara.common.core.validate.AddGroup; |
|
||||
import org.dromara.common.core.validate.EditGroup; |
|
||||
import io.github.linpeilie.annotations.AutoMapper; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
import jakarta.validation.constraints.*; |
|
||||
|
|
||||
/** |
|
||||
* 趋势行为分析-区域统计业务对象 dashboard_trend_area_stat |
|
||||
* |
|
||||
* @author Lion Li |
|
||||
* @date 2026-05-27 |
|
||||
*/ |
|
||||
@Data |
|
||||
@EqualsAndHashCode(callSuper = true) |
|
||||
@AutoMapper(target = DashboardTrendAreaStat.class, reverseConvertGenerate = false) |
|
||||
public class DashboardTrendAreaStatBo extends BaseEntity { |
|
||||
|
|
||||
/** |
|
||||
* 主键ID |
|
||||
*/ |
|
||||
@NotBlank(message = "主键ID不能为空", groups = { EditGroup.class }) |
|
||||
private String id; |
|
||||
|
|
||||
/** |
|
||||
* 年份 |
|
||||
*/ |
|
||||
@NotNull(message = "年份不能为空", groups = { AddGroup.class, EditGroup.class }) |
|
||||
private Long year; |
|
||||
|
|
||||
/** |
|
||||
* 季度:1-一季度 2-二季度 3-三季度 4-四季度 |
|
||||
*/ |
|
||||
@NotNull(message = "季度:1-一季度 2-二季度 3-三季度 4-四季度不能为空", groups = { AddGroup.class, EditGroup.class }) |
|
||||
private Long quarter; |
|
||||
|
|
||||
/** |
|
||||
* 区编码 |
|
||||
*/ |
|
||||
private String districtCode; |
|
||||
|
|
||||
/** |
|
||||
* 区名称 |
|
||||
*/ |
|
||||
private String districtName; |
|
||||
|
|
||||
/** |
|
||||
* 检查次数 |
|
||||
*/ |
|
||||
private Long jccs; |
|
||||
|
|
||||
/** |
|
||||
* 评级A+数量 |
|
||||
*/ |
|
||||
private Long djAPlus; |
|
||||
|
|
||||
/** |
|
||||
* 评级A数量 |
|
||||
*/ |
|
||||
private Long djA; |
|
||||
|
|
||||
/** |
|
||||
* 评级B数量 |
|
||||
*/ |
|
||||
private Long djB; |
|
||||
|
|
||||
/** |
|
||||
* 评级C数量 |
|
||||
*/ |
|
||||
private Long djC; |
|
||||
|
|
||||
/** |
|
||||
* 评级D数量 |
|
||||
*/ |
|
||||
private Long djD; |
|
||||
|
|
||||
/** |
|
||||
* 评级E数量 |
|
||||
*/ |
|
||||
private Long djE; |
|
||||
|
|
||||
/** |
|
||||
* 违规次数 |
|
||||
*/ |
|
||||
private Long wgcs; |
|
||||
|
|
||||
/** |
|
||||
* 逻辑删除:0-否 1-是 |
|
||||
*/ |
|
||||
private String isDelete; |
|
||||
|
|
||||
/** |
|
||||
* 执法单位ID |
|
||||
*/ |
|
||||
private String bureauDeptId; |
|
||||
|
|
||||
/** |
|
||||
* 部门ID |
|
||||
*/ |
|
||||
private String deptId; |
|
||||
|
|
||||
/** |
|
||||
* 组织单位ID |
|
||||
*/ |
|
||||
private String organId; |
|
||||
|
|
||||
|
|
||||
} |
|
||||
@ -1,32 +0,0 @@ |
|||||
package com.zdxt.enforcementcode.domain.vo; |
|
||||
|
|
||||
import lombok.Data; |
|
||||
|
|
||||
import java.io.Serial; |
|
||||
import java.io.Serializable; |
|
||||
import java.util.HashMap; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 区域季度统计分类VO(按检查数量分类统计) |
|
||||
* |
|
||||
* @author Lion Li |
|
||||
* @date 2026-05-27 |
|
||||
*/ |
|
||||
@Data |
|
||||
public class AreaQuarterStatCategoryVo implements Serializable { |
|
||||
|
|
||||
@Serial |
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** |
|
||||
* 区域季度统计数据 |
|
||||
*/ |
|
||||
List<DashboardTrendAreaStatVo> dateList; |
|
||||
|
|
||||
/** |
|
||||
* 区域季度统计分类 |
|
||||
*/ |
|
||||
HashMap<String, List<DashboardTrendAreaStatVo>> categoryMap; |
|
||||
|
|
||||
} |
|
||||
@ -1,135 +0,0 @@ |
|||||
package com.zdxt.enforcementcode.domain.vo; |
|
||||
|
|
||||
|
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
|
||||
import cn.idev.excel.annotation.ExcelProperty; |
|
||||
import com.zdxt.enforcementcode.domain.bean.DashboardTrendAreaStat; |
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|
||||
import io.github.linpeilie.annotations.AutoMapper; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
import java.io.Serial; |
|
||||
import java.io.Serializable; |
|
||||
import java.util.Date; |
|
||||
|
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* 趋势行为分析-区域统计视图对象 dashboard_trend_area_stat |
|
||||
* |
|
||||
* @author Lion Li |
|
||||
* @date 2026-05-27 |
|
||||
*/ |
|
||||
@Data |
|
||||
@ExcelIgnoreUnannotated |
|
||||
@AutoMapper(target = DashboardTrendAreaStat.class) |
|
||||
public class DashboardTrendAreaStatVo implements Serializable { |
|
||||
|
|
||||
@Serial |
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** |
|
||||
* 主键ID |
|
||||
*/ |
|
||||
@ExcelProperty(value = "主键ID") |
|
||||
private String id; |
|
||||
|
|
||||
/** |
|
||||
* 年份 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "年份") |
|
||||
private Long year; |
|
||||
|
|
||||
/** |
|
||||
* 季度:1-一季度 2-二季度 3-三季度 4-四季度 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "季度:1-一季度 2-二季度 3-三季度 4-四季度") |
|
||||
private Long quarter; |
|
||||
|
|
||||
/** |
|
||||
* 区编码 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "区编码") |
|
||||
private String districtCode; |
|
||||
|
|
||||
/** |
|
||||
* 区名称 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "区名称") |
|
||||
private String districtName; |
|
||||
|
|
||||
/** |
|
||||
* 检查次数 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "检查次数") |
|
||||
private Long jccs; |
|
||||
|
|
||||
/** |
|
||||
* 评级A+数量 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "评级A+数量") |
|
||||
private Long djAPlus; |
|
||||
|
|
||||
/** |
|
||||
* 评级A数量 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "评级A数量") |
|
||||
private Long djA; |
|
||||
|
|
||||
/** |
|
||||
* 评级B数量 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "评级B数量") |
|
||||
private Long djB; |
|
||||
|
|
||||
/** |
|
||||
* 评级C数量 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "评级C数量") |
|
||||
private Long djC; |
|
||||
|
|
||||
/** |
|
||||
* 评级D数量 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "评级D数量") |
|
||||
private Long djD; |
|
||||
|
|
||||
/** |
|
||||
* 评级E数量 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "评级E数量") |
|
||||
private Long djE; |
|
||||
|
|
||||
/** |
|
||||
* 违规次数 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "违规次数") |
|
||||
private Long wgcs; |
|
||||
|
|
||||
/** |
|
||||
* 逻辑删除:0-否 1-是 |
|
||||
*/ |
|
||||
@ExcelProperty(value = "逻辑删除:0-否 1-是") |
|
||||
private String isDelete; |
|
||||
|
|
||||
/** |
|
||||
* 执法单位ID |
|
||||
*/ |
|
||||
@ExcelProperty(value = "执法单位ID") |
|
||||
private String bureauDeptId; |
|
||||
|
|
||||
/** |
|
||||
* 部门ID |
|
||||
*/ |
|
||||
@ExcelProperty(value = "部门ID") |
|
||||
private String deptId; |
|
||||
|
|
||||
/** |
|
||||
* 组织单位ID |
|
||||
*/ |
|
||||
@ExcelProperty(value = "组织单位ID") |
|
||||
private String organId; |
|
||||
|
|
||||
|
|
||||
} |
|
||||
@ -1,27 +0,0 @@ |
|||||
package com.zdxt.enforcementcode.mapper; |
|
||||
|
|
||||
|
|
||||
import com.zdxt.enforcementcode.domain.bean.DashboardTrendAreaStat; |
|
||||
import com.zdxt.enforcementcode.domain.bo.AreaQuarterStatQueryBo; |
|
||||
import com.zdxt.enforcementcode.domain.vo.DashboardTrendAreaStatVo; |
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 趋势行为分析-区域统计Mapper接口 |
|
||||
* |
|
||||
* @author Lion Li |
|
||||
* @date 2026-05-27 |
|
||||
*/ |
|
||||
public interface DashboardTrendAreaStatMapper extends BaseMapperPlus<DashboardTrendAreaStat, DashboardTrendAreaStatVo> { |
|
||||
|
|
||||
/** |
|
||||
* 查询区域季度统计数据 |
|
||||
* |
|
||||
* @param queryBo 查询参数 |
|
||||
* @return 区域季度统计列表 |
|
||||
*/ |
|
||||
List<DashboardTrendAreaStatVo> queryAreaQuarterStat(AreaQuarterStatQueryBo queryBo); |
|
||||
|
|
||||
} |
|
||||
@ -1,86 +0,0 @@ |
|||||
package com.zdxt.enforcementcode.service; |
|
||||
|
|
||||
import com.zdxt.enforcementcode.domain.bo.AreaQuarterStatQueryBo; |
|
||||
import com.zdxt.enforcementcode.domain.vo.AreaQuarterStatCategoryVo; |
|
||||
import com.zdxt.enforcementcode.domain.vo.DashboardTrendAreaStatVo; |
|
||||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendAreaStatBo; |
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
||||
import org.dromara.common.mybatis.core.page.PageQuery; |
|
||||
|
|
||||
import java.util.Collection; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 趋势行为分析-区域统计Service接口 |
|
||||
* |
|
||||
* @author Lion Li |
|
||||
* @date 2026-05-27 |
|
||||
*/ |
|
||||
public interface IDashboardTrendAreaStatService { |
|
||||
|
|
||||
/** |
|
||||
* 查询趋势行为分析-区域统计 |
|
||||
* |
|
||||
* @param id 主键 |
|
||||
* @return 趋势行为分析-区域统计 |
|
||||
*/ |
|
||||
DashboardTrendAreaStatVo queryById(String id); |
|
||||
|
|
||||
/** |
|
||||
* 分页查询趋势行为分析-区域统计列表 |
|
||||
* |
|
||||
* @param bo 查询条件 |
|
||||
* @param pageQuery 分页参数 |
|
||||
* @return 趋势行为分析-区域统计分页列表 |
|
||||
*/ |
|
||||
TableDataInfo<DashboardTrendAreaStatVo> queryPageList(DashboardTrendAreaStatBo bo, PageQuery pageQuery); |
|
||||
|
|
||||
/** |
|
||||
* 查询符合条件的趋势行为分析-区域统计列表 |
|
||||
* |
|
||||
* @param bo 查询条件 |
|
||||
* @return 趋势行为分析-区域统计列表 |
|
||||
*/ |
|
||||
List<DashboardTrendAreaStatVo> queryList(DashboardTrendAreaStatBo bo); |
|
||||
|
|
||||
/** |
|
||||
* 新增趋势行为分析-区域统计 |
|
||||
* |
|
||||
* @param bo 趋势行为分析-区域统计 |
|
||||
* @return 是否新增成功 |
|
||||
*/ |
|
||||
Boolean insertByBo(DashboardTrendAreaStatBo bo); |
|
||||
|
|
||||
/** |
|
||||
* 修改趋势行为分析-区域统计 |
|
||||
* |
|
||||
* @param bo 趋势行为分析-区域统计 |
|
||||
* @return 是否修改成功 |
|
||||
*/ |
|
||||
Boolean updateByBo(DashboardTrendAreaStatBo bo); |
|
||||
|
|
||||
/** |
|
||||
* 校验并批量删除趋势行为分析-区域统计信息 |
|
||||
* |
|
||||
* @param ids 待删除的主键集合 |
|
||||
* @param isValid 是否进行有效性校验 |
|
||||
* @return 是否删除成功 |
|
||||
*/ |
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid); |
|
||||
|
|
||||
/** |
|
||||
* 查询区域季度统计数据 |
|
||||
* |
|
||||
* @param queryBo 查询参数 |
|
||||
* @return 区域季度统计列表 |
|
||||
*/ |
|
||||
List<DashboardTrendAreaStatVo> queryAreaQuarterStat(AreaQuarterStatQueryBo queryBo); |
|
||||
|
|
||||
/** |
|
||||
* 查询区域季度统计数据(按检查数量分类统计) |
|
||||
* |
|
||||
* @param queryBo 查询参数 |
|
||||
* @return 分类统计结果 |
|
||||
*/ |
|
||||
List<DashboardTrendAreaStatVo> queryAreaQuarterStatByCategory(AreaQuarterStatQueryBo queryBo); |
|
||||
} |
|
||||
@ -1,216 +0,0 @@ |
|||||
package com.zdxt.enforcementcode.service.impl; |
|
||||
|
|
||||
import cn.hutool.core.collection.CollUtil; |
|
||||
import com.zdxt.enforcementcode.domain.bean.DashboardTrendAreaStat; |
|
||||
import com.zdxt.enforcementcode.domain.bo.AreaQuarterStatQueryBo; |
|
||||
import com.zdxt.enforcementcode.domain.vo.AreaQuarterStatCategoryVo; |
|
||||
import org.dromara.common.core.utils.MapstructUtils; |
|
||||
import org.dromara.common.core.utils.StringUtils; |
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
||||
import org.dromara.common.mybatis.core.page.PageQuery; |
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
||||
import lombok.RequiredArgsConstructor; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendAreaStatBo; |
|
||||
import com.zdxt.enforcementcode.domain.vo.DashboardTrendAreaStatVo; |
|
||||
import com.zdxt.enforcementcode.mapper.DashboardTrendAreaStatMapper; |
|
||||
import com.zdxt.enforcementcode.service.IDashboardTrendAreaStatService; |
|
||||
|
|
||||
import java.util.*; |
|
||||
|
|
||||
/** |
|
||||
* 趋势行为分析-区域统计Service业务层处理 |
|
||||
* |
|
||||
* @author Lion Li |
|
||||
* @date 2026-05-27 |
|
||||
*/ |
|
||||
@Slf4j |
|
||||
@RequiredArgsConstructor |
|
||||
@Service |
|
||||
public class DashboardTrendAreaStatServiceImpl implements IDashboardTrendAreaStatService { |
|
||||
|
|
||||
private final DashboardTrendAreaStatMapper baseMapper; |
|
||||
|
|
||||
/** |
|
||||
* 查询趋势行为分析-区域统计 |
|
||||
* |
|
||||
* @param id 主键 |
|
||||
* @return 趋势行为分析-区域统计 |
|
||||
*/ |
|
||||
@Override |
|
||||
public DashboardTrendAreaStatVo queryById(String id){ |
|
||||
return baseMapper.selectVoById(id); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 分页查询趋势行为分析-区域统计列表 |
|
||||
* |
|
||||
* @param bo 查询条件 |
|
||||
* @param pageQuery 分页参数 |
|
||||
* @return 趋势行为分析-区域统计分页列表 |
|
||||
*/ |
|
||||
@Override |
|
||||
public TableDataInfo<DashboardTrendAreaStatVo> queryPageList(DashboardTrendAreaStatBo bo, PageQuery pageQuery) { |
|
||||
LambdaQueryWrapper<DashboardTrendAreaStat> lqw = buildQueryWrapper(bo); |
|
||||
Page<DashboardTrendAreaStatVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|
||||
return TableDataInfo.build(result); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询符合条件的趋势行为分析-区域统计列表 |
|
||||
* |
|
||||
* @param bo 查询条件 |
|
||||
* @return 趋势行为分析-区域统计列表 |
|
||||
*/ |
|
||||
@Override |
|
||||
public List<DashboardTrendAreaStatVo> queryList(DashboardTrendAreaStatBo bo) { |
|
||||
LambdaQueryWrapper<DashboardTrendAreaStat> lqw = buildQueryWrapper(bo); |
|
||||
return baseMapper.selectVoList(lqw); |
|
||||
} |
|
||||
|
|
||||
private LambdaQueryWrapper<DashboardTrendAreaStat> buildQueryWrapper(DashboardTrendAreaStatBo bo) { |
|
||||
Map<String, Object> params = bo.getParams(); |
|
||||
LambdaQueryWrapper<DashboardTrendAreaStat> lqw = Wrappers.lambdaQuery(); |
|
||||
lqw.orderByAsc(DashboardTrendAreaStat::getId); |
|
||||
lqw.eq(bo.getYear() != null, DashboardTrendAreaStat::getYear, bo.getYear()); |
|
||||
lqw.eq(bo.getQuarter() != null, DashboardTrendAreaStat::getQuarter, bo.getQuarter()); |
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDistrictCode()), DashboardTrendAreaStat::getDistrictCode, bo.getDistrictCode()); |
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDistrictName()), DashboardTrendAreaStat::getDistrictName, bo.getDistrictName()); |
|
||||
lqw.eq(bo.getJccs() != null, DashboardTrendAreaStat::getJccs, bo.getJccs()); |
|
||||
lqw.eq(bo.getDjAPlus() != null, DashboardTrendAreaStat::getDjAPlus, bo.getDjAPlus()); |
|
||||
lqw.eq(bo.getDjA() != null, DashboardTrendAreaStat::getDjA, bo.getDjA()); |
|
||||
lqw.eq(bo.getDjB() != null, DashboardTrendAreaStat::getDjB, bo.getDjB()); |
|
||||
lqw.eq(bo.getDjC() != null, DashboardTrendAreaStat::getDjC, bo.getDjC()); |
|
||||
lqw.eq(bo.getDjD() != null, DashboardTrendAreaStat::getDjD, bo.getDjD()); |
|
||||
lqw.eq(bo.getDjE() != null, DashboardTrendAreaStat::getDjE, bo.getDjE()); |
|
||||
lqw.eq(bo.getWgcs() != null, DashboardTrendAreaStat::getWgcs, bo.getWgcs()); |
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsDelete()), DashboardTrendAreaStat::getIsDelete, bo.getIsDelete()); |
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBureauDeptId()), DashboardTrendAreaStat::getBureauDeptId, bo.getBureauDeptId()); |
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), DashboardTrendAreaStat::getDeptId, bo.getDeptId()); |
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrganId()), DashboardTrendAreaStat::getOrganId, bo.getOrganId()); |
|
||||
return lqw; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 新增趋势行为分析-区域统计 |
|
||||
* |
|
||||
* @param bo 趋势行为分析-区域统计 |
|
||||
* @return 是否新增成功 |
|
||||
*/ |
|
||||
@Override |
|
||||
public Boolean insertByBo(DashboardTrendAreaStatBo bo) { |
|
||||
DashboardTrendAreaStat add = MapstructUtils.convert(bo, DashboardTrendAreaStat.class); |
|
||||
validEntityBeforeSave(add); |
|
||||
boolean flag = baseMapper.insert(add) > 0; |
|
||||
if (flag) { |
|
||||
bo.setId(add.getId()); |
|
||||
} |
|
||||
return flag; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改趋势行为分析-区域统计 |
|
||||
* |
|
||||
* @param bo 趋势行为分析-区域统计 |
|
||||
* @return 是否修改成功 |
|
||||
*/ |
|
||||
@Override |
|
||||
public Boolean updateByBo(DashboardTrendAreaStatBo bo) { |
|
||||
DashboardTrendAreaStat update = MapstructUtils.convert(bo, DashboardTrendAreaStat.class); |
|
||||
validEntityBeforeSave(update); |
|
||||
return baseMapper.updateById(update) > 0; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 保存前的数据校验 |
|
||||
*/ |
|
||||
private void validEntityBeforeSave(DashboardTrendAreaStat entity){ |
|
||||
//TODO 做一些数据校验,如唯一约束
|
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 校验并批量删除趋势行为分析-区域统计信息 |
|
||||
* |
|
||||
* @param ids 待删除的主键集合 |
|
||||
* @param isValid 是否进行有效性校验 |
|
||||
* @return 是否删除成功 |
|
||||
*/ |
|
||||
@Override |
|
||||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) { |
|
||||
if(isValid){ |
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
|
||||
} |
|
||||
return baseMapper.deleteByIds(ids) > 0; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询区域季度统计数据 |
|
||||
* 默认查询当前系统日期前四个季度的数据(不包含当前季度) |
|
||||
* |
|
||||
* @param queryBo 查询参数 |
|
||||
* @return 区域季度统计列表 |
|
||||
*/ |
|
||||
@Override |
|
||||
public List<DashboardTrendAreaStatVo> queryAreaQuarterStat(AreaQuarterStatQueryBo queryBo) { |
|
||||
// 如果未指定起始和结束季度,默认查询当前系统日期前四个季度的数据(不包含当前季度)
|
|
||||
if (queryBo.getStartYear() == null || queryBo.getStartQuarter() == null |
|
||||
|| queryBo.getEndYear() == null || queryBo.getEndQuarter() == null) { |
|
||||
java.time.LocalDate now = java.time.LocalDate.now(); |
|
||||
int currentMonth = now.getMonthValue(); |
|
||||
int currentYear = now.getYear(); |
|
||||
|
|
||||
// 计算当前季度
|
|
||||
int currentQuarter = (currentMonth - 1) / 3 + 1; |
|
||||
|
|
||||
// 计算结束季度(当前季度的前一个季度)
|
|
||||
int endQuarter; |
|
||||
int endYear; |
|
||||
if (currentQuarter == 1) { |
|
||||
// 如果当前是Q1,结束季度是上一年的Q4
|
|
||||
endQuarter = 4; |
|
||||
endYear = currentYear - 1; |
|
||||
} else { |
|
||||
// 否则结束季度是当前年份的前一个季度
|
|
||||
endQuarter = currentQuarter - 1; |
|
||||
endYear = currentYear; |
|
||||
} |
|
||||
|
|
||||
// 计算起始季度(往前推3个季度)
|
|
||||
int startQuarter; |
|
||||
int startYear; |
|
||||
if (endQuarter >= 4) { |
|
||||
startQuarter = endQuarter - 3; |
|
||||
startYear = endYear; |
|
||||
} else { |
|
||||
startQuarter = endQuarter + 1; |
|
||||
startYear = endYear - 1; |
|
||||
} |
|
||||
|
|
||||
queryBo.setStartYear((long) startYear); |
|
||||
queryBo.setStartQuarter(startQuarter); |
|
||||
queryBo.setEndYear((long) endYear); |
|
||||
queryBo.setEndQuarter(endQuarter); |
|
||||
} |
|
||||
|
|
||||
return baseMapper.queryAreaQuarterStat(queryBo); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 查询区域季度统计数据(按检查数量分类统计) |
|
||||
* |
|
||||
* @param queryBo 查询参数 |
|
||||
* @return 分类统计结果 |
|
||||
*/ |
|
||||
@Override |
|
||||
public List<DashboardTrendAreaStatVo> queryAreaQuarterStatByCategory(AreaQuarterStatQueryBo queryBo) { |
|
||||
// 先查询所有区域的季度统计数据
|
|
||||
List<DashboardTrendAreaStatVo> resultList = queryAreaQuarterStat(queryBo); |
|
||||
if (CollUtil.isEmpty(resultList)) { |
|
||||
return new ArrayList<>(); |
|
||||
} |
|
||||
return resultList; |
|
||||
} |
|
||||
} |
|
||||
@ -1,37 +0,0 @@ |
|||||
<?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.zdxt.enforcementcode.mapper.DashboardTrendAreaStatMapper"> |
|
||||
|
|
||||
<!-- 查询区域季度统计数据 --> |
|
||||
<select id="queryAreaQuarterStat" resultType="com.zdxt.enforcementcode.domain.vo.DashboardTrendAreaStatVo"> |
|
||||
SELECT |
|
||||
a.* |
|
||||
FROM sys_area_info b |
|
||||
LEFT JOIN dashboard_trend_area_stat a |
|
||||
ON a.district_code = b.district_code |
|
||||
WHERE b.is_delete = '0' |
|
||||
<if test="startYear != null and startQuarter != null and endYear != null and endQuarter != null"> |
|
||||
AND ( |
|
||||
(a.year = #{startYear} AND a.quarter >= #{startQuarter}) |
|
||||
OR (a.year > #{startYear} AND a.year < #{endYear}) |
|
||||
OR (a.year = #{endYear} AND a.quarter <= #{endQuarter}) |
|
||||
) |
|
||||
</if> |
|
||||
|
|
||||
<if test="districtCode != null and districtCode != ''"> |
|
||||
AND a.district_code = #{districtCode} |
|
||||
</if> |
|
||||
|
|
||||
<if test="districtName != null and districtName != ''"> |
|
||||
AND a.district_name LIKE CONCAT('%', #{districtName}, '%') |
|
||||
</if> |
|
||||
|
|
||||
ORDER BY |
|
||||
IFNULL(b.sort, 999), |
|
||||
a.year, |
|
||||
a.quarter |
|
||||
</select> |
|
||||
|
|
||||
</mapper> |
|
||||
Loading…
Reference in new issue