15 changed files with 808 additions and 4 deletions
@ -0,0 +1,105 @@ |
|||
package com.zdxt.enforcementcode.controller.web.supervision; |
|||
|
|||
import java.util.List; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardTrendStatAreaVo; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatAreaBo; |
|||
import com.zdxt.enforcementcode.service.IDashboardTrendStatAreaService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 趋势行为分析-区域-统计 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-06-11 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/enforcementcode/trendStatArea") |
|||
public class DashboardTrendStatAreaController extends BaseController { |
|||
|
|||
private final IDashboardTrendStatAreaService dashboardTrendStatAreaService; |
|||
|
|||
/** |
|||
* 查询趋势行为分析-区域-统计列表 |
|||
*/ |
|||
|
|||
@GetMapping("/list") |
|||
public TableDataInfo<DashboardTrendStatAreaVo> list(DashboardTrendStatAreaBo bo, PageQuery pageQuery) { |
|||
return dashboardTrendStatAreaService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出趋势行为分析-区域-统计列表 |
|||
*/ |
|||
|
|||
@Log(title = "趋势行为分析-区域-统计", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(DashboardTrendStatAreaBo bo, HttpServletResponse response) { |
|||
List<DashboardTrendStatAreaVo> list = dashboardTrendStatAreaService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "趋势行为分析-区域-统计", DashboardTrendStatAreaVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取趋势行为分析-区域-统计详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("enforcementcode:trendStatArea:query") |
|||
@GetMapping("/{id}") |
|||
public R<DashboardTrendStatAreaVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(dashboardTrendStatAreaService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增趋势行为分析-区域-统计 |
|||
*/ |
|||
@SaCheckPermission("enforcementcode:trendStatArea:add") |
|||
@Log(title = "趋势行为分析-区域-统计", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DashboardTrendStatAreaBo bo) { |
|||
return toAjax(dashboardTrendStatAreaService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改趋势行为分析-区域-统计 |
|||
*/ |
|||
@SaCheckPermission("enforcementcode:trendStatArea:edit") |
|||
@Log(title = "趋势行为分析-区域-统计", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DashboardTrendStatAreaBo bo) { |
|||
return toAjax(dashboardTrendStatAreaService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除趋势行为分析-区域-统计 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("enforcementcode:trendStatArea:remove") |
|||
@Log(title = "趋势行为分析-区域-统计", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(dashboardTrendStatAreaService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
|||
@ -0,0 +1,111 @@ |
|||
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_stat_area |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-06-11 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("dashboard_trend_stat_area") |
|||
public class DashboardTrendStatArea extends BaseEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long 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; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,113 @@ |
|||
package com.zdxt.enforcementcode.domain.bo; |
|||
|
|||
|
|||
import com.zdxt.enforcementcode.domain.bean.DashboardTrendStatArea; |
|||
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_stat_area |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-06-11 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = DashboardTrendStatArea.class, reverseConvertGenerate = false) |
|||
public class DashboardTrendStatAreaBo extends BaseEntity { |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) |
|||
private Long 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; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,134 @@ |
|||
package com.zdxt.enforcementcode.domain.vo; |
|||
|
|||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
|||
import cn.idev.excel.annotation.ExcelProperty; |
|||
import com.zdxt.enforcementcode.domain.bean.DashboardTrendStatArea; |
|||
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_stat_area |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-06-11 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = DashboardTrendStatArea.class) |
|||
public class DashboardTrendStatAreaVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
@ExcelProperty(value = "主键ID") |
|||
private Long 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; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package com.zdxt.enforcementcode.mapper; |
|||
|
|||
|
|||
import com.zdxt.enforcementcode.domain.bean.DashboardTrendStatArea; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatQueryBo; |
|||
import com.zdxt.enforcementcode.domain.vo.AreaQuarterStatVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardTrendStatAreaVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 趋势行为分析-区域-统计Mapper接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-06-11 |
|||
*/ |
|||
public interface DashboardTrendStatAreaMapper extends BaseMapperPlus<DashboardTrendStatArea, DashboardTrendStatAreaVo> { |
|||
|
|||
|
|||
/** |
|||
* 区域+季节(信用)检查次数 |
|||
* |
|||
* @param queryBo 查询参数 |
|||
* @return 区域季度统计列表 |
|||
*/ |
|||
List<AreaQuarterStatVo> areaQuarterCheck(DashboardTrendStatQueryBo queryBo); |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package com.zdxt.enforcementcode.service; |
|||
|
|||
import com.zdxt.enforcementcode.domain.vo.DashboardTrendStatAreaVo; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatAreaBo; |
|||
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-06-11 |
|||
*/ |
|||
public interface IDashboardTrendStatAreaService { |
|||
|
|||
/** |
|||
* 查询趋势行为分析-区域-统计 |
|||
* |
|||
* @param id 主键 |
|||
* @return 趋势行为分析-区域-统计 |
|||
*/ |
|||
DashboardTrendStatAreaVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询趋势行为分析-区域-统计列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 趋势行为分析-区域-统计分页列表 |
|||
*/ |
|||
TableDataInfo<DashboardTrendStatAreaVo> queryPageList(DashboardTrendStatAreaBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的趋势行为分析-区域-统计列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 趋势行为分析-区域-统计列表 |
|||
*/ |
|||
List<DashboardTrendStatAreaVo> queryList(DashboardTrendStatAreaBo bo); |
|||
|
|||
/** |
|||
* 新增趋势行为分析-区域-统计 |
|||
* |
|||
* @param bo 趋势行为分析-区域-统计 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(DashboardTrendStatAreaBo bo); |
|||
|
|||
/** |
|||
* 修改趋势行为分析-区域-统计 |
|||
* |
|||
* @param bo 趋势行为分析-区域-统计 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(DashboardTrendStatAreaBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除趋势行为分析-区域-统计信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
|||
@ -0,0 +1,147 @@ |
|||
package com.zdxt.enforcementcode.service.impl; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bean.DashboardTrendStatArea; |
|||
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.DashboardTrendStatAreaBo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardTrendStatAreaVo; |
|||
import com.zdxt.enforcementcode.mapper.DashboardTrendStatAreaMapper; |
|||
import com.zdxt.enforcementcode.service.IDashboardTrendStatAreaService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 趋势行为分析-区域-统计Service业务层处理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-06-11 |
|||
*/ |
|||
@Slf4j |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class DashboardTrendStatAreaServiceImpl implements IDashboardTrendStatAreaService { |
|||
|
|||
private final DashboardTrendStatAreaMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询趋势行为分析-区域-统计 |
|||
* |
|||
* @param id 主键 |
|||
* @return 趋势行为分析-区域-统计 |
|||
*/ |
|||
@Override |
|||
public DashboardTrendStatAreaVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询趋势行为分析-区域-统计列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 趋势行为分析-区域-统计分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<DashboardTrendStatAreaVo> queryPageList(DashboardTrendStatAreaBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<DashboardTrendStatArea> lqw = buildQueryWrapper(bo); |
|||
Page<DashboardTrendStatAreaVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的趋势行为分析-区域-统计列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 趋势行为分析-区域-统计列表 |
|||
*/ |
|||
@Override |
|||
public List<DashboardTrendStatAreaVo> queryList(DashboardTrendStatAreaBo bo) { |
|||
LambdaQueryWrapper<DashboardTrendStatArea> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<DashboardTrendStatArea> buildQueryWrapper(DashboardTrendStatAreaBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<DashboardTrendStatArea> lqw = Wrappers.lambdaQuery(); |
|||
lqw.orderByAsc(DashboardTrendStatArea::getId); |
|||
lqw.eq(bo.getYear() != null, DashboardTrendStatArea::getYear, bo.getYear()); |
|||
lqw.eq(bo.getQuarter() != null, DashboardTrendStatArea::getQuarter, bo.getQuarter()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getDistrictCode()), DashboardTrendStatArea::getDistrictCode, bo.getDistrictCode()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getDistrictName()), DashboardTrendStatArea::getDistrictName, bo.getDistrictName()); |
|||
lqw.eq(bo.getJccs() != null, DashboardTrendStatArea::getJccs, bo.getJccs()); |
|||
lqw.eq(bo.getDjAPlus() != null, DashboardTrendStatArea::getDjAPlus, bo.getDjAPlus()); |
|||
lqw.eq(bo.getDjA() != null, DashboardTrendStatArea::getDjA, bo.getDjA()); |
|||
lqw.eq(bo.getDjB() != null, DashboardTrendStatArea::getDjB, bo.getDjB()); |
|||
lqw.eq(bo.getDjC() != null, DashboardTrendStatArea::getDjC, bo.getDjC()); |
|||
lqw.eq(bo.getDjD() != null, DashboardTrendStatArea::getDjD, bo.getDjD()); |
|||
lqw.eq(bo.getDjE() != null, DashboardTrendStatArea::getDjE, bo.getDjE()); |
|||
lqw.eq(bo.getWgcs() != null, DashboardTrendStatArea::getWgcs, bo.getWgcs()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getIsDelete()), DashboardTrendStatArea::getIsDelete, bo.getIsDelete()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getBureauDeptId()), DashboardTrendStatArea::getBureauDeptId, bo.getBureauDeptId()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), DashboardTrendStatArea::getDeptId, bo.getDeptId()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getOrganId()), DashboardTrendStatArea::getOrganId, bo.getOrganId()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增趋势行为分析-区域-统计 |
|||
* |
|||
* @param bo 趋势行为分析-区域-统计 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(DashboardTrendStatAreaBo bo) { |
|||
DashboardTrendStatArea add = MapstructUtils.convert(bo, DashboardTrendStatArea.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改趋势行为分析-区域-统计 |
|||
* |
|||
* @param bo 趋势行为分析-区域-统计 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(DashboardTrendStatAreaBo bo) { |
|||
DashboardTrendStatArea update = MapstructUtils.convert(bo, DashboardTrendStatArea.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(DashboardTrendStatArea entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除趋势行为分析-区域-统计信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
<?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.DashboardTrendStatAreaMapper"> |
|||
|
|||
|
|||
<!-- 区域+季节(信用)检查次数 --> |
|||
<select id="areaQuarterCheck" resultType="com.zdxt.enforcementcode.domain.vo.AreaQuarterStatVo"> |
|||
SELECT |
|||
a.district_code, |
|||
a.district_name, |
|||
a.year, |
|||
a.quarter, |
|||
IFNULL(SUM(a.jccs), 0) AS jccs, |
|||
IFNULL(SUM(a.dj_a_plus), 0) AS djAPlus, |
|||
IFNULL(SUM(a.dj_a), 0) AS djA, |
|||
IFNULL(SUM(a.dj_b), 0) AS djB, |
|||
IFNULL(SUM(a.dj_c), 0) AS djC, |
|||
IFNULL(SUM(a.dj_d), 0) AS djD, |
|||
IFNULL(SUM(a.dj_e), 0) AS djE, |
|||
IFNULL(SUM(a.wgcs), 0) AS wgcs |
|||
dashboard_trend_stat_area a |
|||
LEFT JOIN dashboard_area_info b ON a.district_code = b.`code` |
|||
AND b.`level` = 2 |
|||
WHERE a.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> |
|||
|
|||
GROUP BY |
|||
a.district_code, |
|||
a.district_name, |
|||
a.year, |
|||
a.quarter |
|||
ORDER BY |
|||
b.sort, |
|||
a.YEAR, |
|||
a.QUARTER |
|||
</select> |
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue