Commit dc83fc65 authored by Hagsn3's avatar Hagsn3

111

parent 6aa8b0d5
package org.rcisoft.bus.mixSelect.controller;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.core.anno.CyOpeLogAnno;
import org.rcisoft.core.constant.CyMessCons;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyResultGenUtil;
import org.rcisoft.bus.mixSelect.entity.RequestDto;
import org.rcisoft.bus.mixSelect.entity.RequestInfromationDto;
import org.rcisoft.bus.mixSelect.service.MixSelectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/mixSelect")
public class MixSelectController {
@Autowired
MixSelectService mixSelectService;
// @PostMapping("/test")
// public Object test(){
// return "Hello";
// }
@PostMapping("/getListTotal")
public CyResult getListTotal(@RequestBody RequestDto requestDto){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.getListTotal(requestDto));
}
@PostMapping("/getList")
public CyResult getList(@RequestBody RequestDto requestDto){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.getList(requestDto));
}
@PostMapping("/getClickInformation")
public CyResult getInformation(@RequestBody RequestInfromationDto requestInfromationDto){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.getInformation(requestInfromationDto));
}
@PostMapping("/getClickInformationPageNum")
public CyResult getClickInformationPageNum(@RequestBody RequestInfromationDto requestInfromationDto){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.getClickInformationPageNum(requestInfromationDto));
}
// @PostMapping("/postTest")
// public String postTest(@RequestBody Test test){
// System.out.println(test.toString());
// return "hello" + test.toString();
// }
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签aaa", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签aaa",notes = "查询标签aaa")
@GetMapping("/searchAaa")
public CyResult searchAaa(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchAaa());
}
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签ccc", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签ccc",notes = "查询标签ccc")
@GetMapping("/searchCcc")
public CyResult searchCcc(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchCcc());
}
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签cccc", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签cccc",notes = "查询标签cccc")
@GetMapping("/searchCccc")
public CyResult searchCccc(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchCccc());
}
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签eee", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签eee",notes = "查询标签eee")
@GetMapping("/searchEee")
public CyResult searchEee(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchEee());
}
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签bbb", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签bbb",notes = "查询标签bbb")
@GetMapping("/searchBbb")
public CyResult searchBbb(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchBbb());
}
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签Ddd", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签Ddd",notes = "查询标签Ddd")
@GetMapping("/searchDdd")
public CyResult searchDdd(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchDdd());
}
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签Dddd", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签eee",notes = "查询标签Dddd")
@GetMapping("/searchDddd")
public CyResult searchDddd(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchDddd());
}
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签nqy", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签nqy",notes = "查询标签nqy")
@GetMapping("/searchNqy")
public CyResult searchNqy(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchNqy());
}
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签khqf", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签khqf",notes = "查询标签khqf")
@GetMapping("/searchKhqf")
public CyResult searchKhqf(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchKhqf());
}
@CyOpeLogAnno(title = "system-DemoData1管理-查询标签jlpm", businessType = CyLogTypeEnum.OTHER)
@ApiOperation(value ="查询标签jlpm",notes = "查询标签jlpm")
@GetMapping("/searchJlpm")
public CyResult searchJlpm(){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
mixSelectService.searchJlpm());
}
}
package org.rcisoft.bus.mixSelect.dao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.rcisoft.bus.mixSelect.entity.DemoData1;
import org.rcisoft.bus.mixSelect.entity.RequestDto;
import org.rcisoft.bus.mixSelect.entity.RequestInfromationDto;
import java.util.List;
import java.util.Map;
@Mapper
public interface MixSelectMapper {
Object test();
List<Map> getListhhh(@Param("entity") RequestDto requestDto, @Param("monthList") String months, @Param("pageNo") int pageNo, @Param("pageSize") int pageSize);
List<Map> getListiii(@Param("entity") RequestDto requestDto, @Param("monthList") String months, @Param("pageNo") int pageNo, @Param("pageSize") int pageSize);
List<Map> getListkkk(@Param("entity") RequestDto requestDto, @Param("monthList") String months, @Param("pageNo") int pageNo, @Param("pageSize") int pageSize);
List<Map> getListfff(@Param("entity") RequestDto requestDto, @Param("monthList") String months, @Param("pageNo") int pageNo, @Param("pageSize") int pageSize);
List<Map> getListggg(@Param("entity") RequestDto requestDto, @Param("monthList") String months, @Param("pageNo") int pageNo, @Param("pageSize") int pageSize);
List<Map> getListjjj(@Param("entity") RequestDto requestDto, @Param("monthList") String months, @Param("pageNo") int pageNo, @Param("pageSize") int pageSize);
List<Map> getListhhhTotal(@Param("entity") RequestDto requestDto, @Param("monthList") String months);
List<Map> getListiiiTotal(@Param("entity") RequestDto requestDto, @Param("monthList") String months);
List<Map> getListkkkTotal(@Param("entity") RequestDto requestDto, @Param("monthList") String months);
List<Map> getListfffTotal(@Param("entity") RequestDto requestDto, @Param("monthList") String months);
List<Map> getListgggTotal(@Param("entity") RequestDto requestDto, @Param("monthList") String months);
List<Map> getListjjjTotal(@Param("entity") RequestDto requestDto, @Param("monthList") String months);
List<String> getMonths();
List<DemoData1> getInformation(@Param("entity") RequestInfromationDto requestInfromationDto);
Integer getClickInformationPageNum(@Param("entity") RequestInfromationDto requestInfromationDto);
// 查询菜单
List<DemoData1> searchAaa();
List<DemoData1> searchCcc();
List<DemoData1> searchCccc();
List<DemoData1> searchEee();
List<String> getMonthsFromDB();
List<DemoData1> searchBbb();
List<DemoData1> searchDddd();
List<DemoData1> searchDdd();
/***新系统*/
List<DemoData1> searchNqy();
List<DemoData1> searchKhqf();
List<DemoData1> searchJlpm();
}
package org.rcisoft.bus.mixSelect.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.rcisoft.core.entity.CyIdIncreEntity;
/**
* Created with cy on 2024年4月8日 上午11:05:47.
*/
@Data
@TableName("demo")
public class DemoData1 extends CyIdIncreEntity<DemoData1> {
private String aaa;
private String bbb;
private String ccc;
private String ddd;
private String cccc;
private String dddd;
private String eee;
private String fff;
private String ggg;
private String hhh;
private String iii;
private String jjj;
private String kkk;
private String lll;
private String mmm;
private String person;
private String month_one_total;
private String month_two_total;
private String month_three_total;
private String month_four_total;
private String month_five_total;
private String month_six_total;
private String month_seven_total;
private String month_eight_total;
private String month_nine_total;
private String month_ten_total;
private String month_eleven_total;
private String month_twelve_total;
private String month;
private String monthList;
/**
* @desc
* @column nqy
* @default
*/
@Excel(name = "nqy", orderNum = "12", width = 20)
private String nqy;
/**
* @desc
* @column szzt
* @default
*/
@Excel(name = "szzt", orderNum = "0", width = 20)
private String szzt;
/**
* @desc
* @column pn
* @default
*/
@Excel(name = "pn", orderNum = "1", width = 20)
private String pn;
/**
* @desc
* @column bz
* @default
*/
@Excel(name = "bz", orderNum = "2", width = 20)
private String bz;
/**
* @desc
* @column yydd
* @default
*/
@Excel(name = "yydd", orderNum = "3", width = 20)
private String yydd;
/**
* @desc
* @column khdm
* @default
*/
@Excel(name = "khdm", orderNum = "4", width = 20)
private String khdm;
/**
* @desc
* @column mksqf
* @default
*/
@Excel(name = "mksqf", orderNum = "5", width = 20)
private String mksqf;
/**
* @desc
* @column khm
* @default
*/
@Excel(name = "khm", orderNum = "6", width = 20)
private String khm;
/**
* @desc
* @column jlpm
* @default
*/
@Excel(name = "jlpm", orderNum = "7", width = 20)
private String jlpm;
/**
* @desc
* @column fzdm
* @default
*/
@Excel(name = "fzdm", orderNum = "8", width = 20)
private String fzdm;
/**
* @desc
* @column l24
* @default
*/
@Excel(name = "l24", orderNum = "9", width = 20)
private String l24;
/**
* @desc
* @column ddjsr
* @default
*/
@Excel(name = "ddjsr", orderNum = "10", width = 20)
private String ddjsr;
/**
* @desc
* @column ddh
* @default
*/
@Excel(name = "ddh", orderNum = "14", width = 20)
private String ddh;
/**
* @desc
* @column khqf
* @default
*/
@Excel(name = "khqf", orderNum = "15", width = 20)
private String khqf;
/**
* @desc
* @column ddzdnq
* @default
*/
@Excel(name = "ddzdnq", orderNum = "16", width = 20)
private String ddzdnq;
/**
* @desc
* @column zd
* @default
*/
@Excel(name = "zd", orderNum = "20", width = 20)
private String zd;
/**
* @desc
* @column fnq
* @default
*/
@Excel(name = "fnq", orderNum = "22", width = 20)
private String fnq;
/**
* @desc
* @column jypn
* @default
*/
@Excel(name = "jypn", orderNum = "23", width = 20)
private String jypn;
/**
* @desc
* @column xslj
* @default
*/
@Excel(name = "xslj", orderNum = "24", width = 20)
private String xslj;
/**选择的复选框Begin**/
/**
* @desc
* @column xsjg
* @default
*/
@Excel(name = "xsjg", orderNum = "17", width = 20)
private String xsjg;
/**
* @desc
* @column zzc
* @default
*/
@Excel(name = "zzc", orderNum = "18", width = 20)
private String zzc;
/**
* @desc
* @column zzcg
* @default
*/
@Excel(name = "zzcg", orderNum = "19", width = 20)
private String zzcg;
/**
* @desc
* @column chzsb
* @default
*/
@Excel(name = "chzsb", orderNum = "21", width = 20)
private String chzsb;
/**
* @desc
* @column chzsa
* @default
*/
@Excel(name = "chzsa", orderNum = "13", width = 20)
private String chzsa;
/**
* @desc
* @column rmb
* @default
*/
@Excel(name = "rmb", orderNum = "11", width = 20)
private String rmb;
/**选择的复选框End**/
}
package org.rcisoft.bus.mixSelect.entity;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Infromation implements Serializable {
//月份
private String aaa;
//必须返回,即使为空
@JsonInclude(JsonInclude.Include.NON_NULL)
private String hhh;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String iii;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String kkk;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String fff;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String ggg;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String jjj;
}
package org.rcisoft.bus.mixSelect.entity;
import lombok.Data;
import java.util.List;
@Data
public class RequestDto {
//aaa集合
private List<String> aaa;
//bbb集合
private List<String> bbb;
//ccc集合
private List<Integer> ccc;
//ddd集合
private List<String> ddd;
//cccc集合
private List<String> cccc;
//dddd集合
private List<String> dddd;
//eee集合
private List<String> eee;
//fff条件
private boolean fff;
//ggg条件
private boolean ggg;
//hhh条件
private boolean hhh;
//iii条件
private boolean iii;
//jjj条件
private boolean jjj;
//kkk条件
private boolean kkk;
//pageSize
private Integer pageSize;
//pageNo
private Integer pageNo;
}
package org.rcisoft.bus.mixSelect.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RequestInfromationDto implements Serializable {
//aaa集合
private List<String> aaa;
//bbb集合
private List<String> bbb;
//ccc集合
private List<Integer> ccc;
//ddd集合
private List<String> ddd;
//cccc集合
private List<String> cccc;
//dddd集合
private List<String> dddd;
//eee集合
private List<String> eee;
//fff条件
private boolean fff;
//ggg条件
private boolean ggg;
//hhh条件
private boolean hhh;
//iii条件
private boolean iii;
//jjj条件
private boolean jjj;
//kkk条件
private boolean kkk;
//特判aaa
private String clickAaa;
//特判Key
private String clickKey;
//特判Val
private String clickValue;
//特判Ccc
private Integer clickCcc;
//pageSize
private Integer pageSize;
//pageNo
private Integer pageNo;
public static void cleanAndBuild(RequestInfromationDto r, String key){
r.fff = false;
r.ggg = false;
r.hhh = false;
r.iii = false;
r.jjj = false;
r.kkk = false;
switch (key){
case "fff":
r.fff = true;
break;
case "ggg":
r.ggg = true;
break;
case "hhh":
r.hhh = true;
break;
case "iii":
r.iii = true;
break;
case "jjj":
r.jjj = true;
break;
case "kkk":
r.kkk = true;
break;
}
r.aaa.clear();
r.aaa.add(r.clickAaa);
}
}
package org.rcisoft.bus.mixSelect.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Data
public class User implements Serializable {
private String ccc;
private List<Infromation> data;
@JsonIgnore
private Map<String,Integer> map;
public User(String ccc, List<String> list, boolean[] flag){
this.map = new HashMap();
this.ccc = ccc;
this.data = new ArrayList<>(list.size());
for (int i = 0; i < list.size(); i++) {
Infromation infromation = new Infromation();
infromation.setAaa(list.get(i));
if (flag[0]){
infromation.setFff("");
}
if (flag[1]){
infromation.setGgg("");
}
if (flag[2]){
infromation.setHhh("");
}
if (flag[3]){
infromation.setIii("");
}
if (flag[4]){
infromation.setJjj("");
}
if (flag[5]){
infromation.setKkk("");
}
this.data.add(infromation);
map.put(list.get(i),i);
}
}
}
package org.rcisoft.bus.mixSelect.service;
import org.rcisoft.bus.mixSelect.entity.DemoData1;
import org.rcisoft.bus.mixSelect.entity.RequestDto;
import org.rcisoft.bus.mixSelect.entity.RequestInfromationDto;
import org.rcisoft.bus.mixSelect.entity.User;
import java.util.List;
public interface MixSelectService {
List<User> getList(RequestDto requestDto);
List<DemoData1> getInformation(RequestInfromationDto requestInfromationDto);
Integer getListTotal(RequestDto requestDto);
Integer getClickInformationPageNum(RequestInfromationDto requestInfromationDto);
List<DemoData1> searchAaa();
List<DemoData1> searchCcc();
List<DemoData1> searchCccc();
List<DemoData1> searchEee();
List<DemoData1> searchBbb();
List<DemoData1> searchDddd();
List<DemoData1> searchDdd();
/**新系统*/
List<DemoData1> searchNqy();
List<DemoData1> searchKhqf();
List<DemoData1> searchJlpm();
}
package org.rcisoft.bus.mixSelect.service.impl;
import org.rcisoft.bus.mixSelect.entity.DemoData1;
import org.rcisoft.bus.mixSelect.dao.MixSelectMapper;
import org.rcisoft.bus.mixSelect.entity.Infromation;
import org.rcisoft.bus.mixSelect.entity.RequestDto;
import org.rcisoft.bus.mixSelect.entity.RequestInfromationDto;
import org.rcisoft.bus.mixSelect.entity.User;
import org.rcisoft.bus.mixSelect.service.MixSelectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class MixSelectServiceImpl implements MixSelectService {
@Autowired
MixSelectMapper mixSelectMapper;
@Override
public List<User> getList(RequestDto requestDto) {
//判断查询条件是否为全空
boolean conditionIsNull = requestDto.isGgg() ||
requestDto.isJjj() ||
requestDto.isKkk() ||
requestDto.isHhh() ||
requestDto.isFff() ||
requestDto.isIii();
//没有选择默认选一个
if (!conditionIsNull){
requestDto.setFff(true);
}
//查询月份,不知道有啥用
List<String> monthsList = mixSelectMapper.getMonths();
String months = monthsList.stream()
// 将每个月份拼接成形如 "[yyyyMM]" 的字符串
.map(month -> "[" + month + "]")
// 使用逗号连接每个月份字符串
.collect(Collectors.joining(","));
List<Map> listhhh = null;
List<Map> listiii = null;
List<Map> listkkk = null;
List<Map> listfff = null;
List<Map> listjjj = null;
List<Map> listggg = null;
//查询数据库
//判断需要查询哪一个
//页数
Integer pageNo = requestDto.getPageNo();
//每页大小
Integer pageSize = requestDto.getPageSize();
//默认查三个
//定义变量进行存储
int count = 0;
boolean[] flag = new boolean[]{false,false,false,false,false,false};
if (requestDto.isFff() && count < 3) {
listfff = mixSelectMapper.getListfff(requestDto, months, pageNo, pageSize);
count++;
flag[0] = true;
}
if (requestDto.isGgg() && count < 3) {
listggg = mixSelectMapper.getListggg(requestDto, months, pageNo, pageSize);
count++;
flag[1] = true;
}
if (requestDto.isHhh() && count < 3) {
listhhh = mixSelectMapper.getListhhh(requestDto, months, pageNo, pageSize);
count++;
flag[2] = true;
}
if (requestDto.isIii() && count < 3) {
listiii = mixSelectMapper.getListiii(requestDto, months, pageNo, pageSize);
count++;
flag[3] = true;
}
if (requestDto.isJjj() && count < 3) {
listjjj = mixSelectMapper.getListjjj(requestDto, months, pageNo, pageSize);
count++;
flag[4] = true;
}
if (requestDto.isKkk() && count < 3) {
listkkk = mixSelectMapper.getListkkk(requestDto, months, pageNo, pageSize);
count++;
flag[5] = true;
}
int size = 0;
//获得返回数据长度
if (listhhh != null) {
size = listhhh.size();
} else if (listiii != null) {
size = listiii.size();
} else if (listkkk != null) {
size = listkkk.size();
} else if (listfff != null) {
size = listfff.size();
} else if (listggg != null) {
size = listggg.size();
}else {
size = listjjj.size();
}
//获取对应关系
Map<String, User> map = new HashMap();
//创建填充数据
List<User> resList = new ArrayList<>();
//获取日期参数
List<String> aaa = requestDto.getAaa();
//判断是否传入日期参数,如果没传入设置默认值
if (aaa == null || aaa.size() == 0){
aaa = monthsList;
}
//填充返回数据
for (int i = 0; i < size; i++) {
//填充三种数据
if (listhhh != null) {
Map listMap = listhhh.get(i);
//获取ccc(用户名)
Integer ccc = (Integer) listMap.get("ccc");
//删除"ccc"
listMap.remove("ccc");
User user = map.getOrDefault(ccc.toString(), null);
//判断该用户是否创建过
if (user == null) {
//创建对象加入到list结果中
user = new User(ccc.toString(), aaa, flag);
resList.add(user);
map.put(ccc.toString(),user);
}
//获取到user中的Data数据
List<Infromation> data = user.getData();
//获取月份对照集合
Map<String, Integer> month = user.getMap();
//set为键值对对象
Set set = listMap.entrySet();
for (Object o : set) {
//强制转化为Entry对象
Map.Entry<String, String> entry = (Map.Entry<String, String>) o;
//获取到数据库中对应的月份
String target = listMap.getOrDefault(entry.getKey(), null).toString();
//不为空添加数据
if (target != null) {
//获取月份对应的下标
Integer index = month.get(entry.getKey());
//获取信息
Infromation infromation = data.get(index);
//原则上调用toString方法能解决,但是JIT自动优化了,只能使用上转型
Object value = entry.getValue();
infromation.setHhh(value.toString());
}
}
}
if (listiii != null) {
//填充三种数据
if (listiii != null) {
Map listMap = listiii.get(i);
//获取ccc(用户名)
Integer ccc = (Integer) listMap.get("ccc");
//删除"ccc"
listMap.remove("ccc");
User user = map.getOrDefault(ccc.toString(), null);
//判断该用户是否创建过
if (user == null) {
//创建对象加入到list结果中
user = new User(ccc.toString(), aaa, flag);
resList.add(user);
map.put(ccc.toString(),user);
}
//获取到user中的Data数据
List<Infromation> data = user.getData();
//获取月份对照集合
Map<String, Integer> month = user.getMap();
//set为键值对对象
Set set = listMap.entrySet();
for (Object o : set) {
//强制转化为Entry对象
Map.Entry<String, String> entry = (Map.Entry<String, String>) o;
//获取到数据库中对应的月份
String target = listMap.getOrDefault(entry.getKey(), null).toString();
//不为空添加数据
if (target != null) {
//获取月份对应的下标
Integer index = month.get(entry.getKey());
//获取信息
Infromation infromation = data.get(index);
//原则上调用toString方法能解决,但是JIT自动优化了,只能使用上转型
Object value = entry.getValue();
infromation.setIii(value.toString());
}
}
}
}
if (listkkk != null) {
Map listMap = listkkk.get(i);
//获取ccc(用户名)
Integer ccc = (Integer) listMap.get("ccc");
//删除"ccc"
listMap.remove("ccc");
User user = map.getOrDefault(ccc.toString(), null);
//判断该用户是否创建过
if (user == null) {
//创建对象加入到list结果中
user = new User(ccc.toString(), aaa, flag);
resList.add(user);
map.put(ccc.toString(),user);
}
//获取到user中的Data数据
List<Infromation> data = user.getData();
//获取月份对照集合
Map<String, Integer> month = user.getMap();
//set为键值对对象
Set set = listMap.entrySet();
for (Object o : set) {
//强制转化为Entry对象
Map.Entry<String, String> entry = (Map.Entry<String, String>) o;
//获取到数据库中对应的月份
String target = listMap.getOrDefault(entry.getKey(), null).toString();
//不为空添加数据
if (target != null) {
//获取月份对应的下标
Integer index = month.get(entry.getKey());
//获取信息
Infromation infromation = data.get(index);
//原则上调用toString方法能解决,但是JIT自动优化了,只能使用上转型
Object value = entry.getValue();
infromation.setKkk(value.toString());
}
}
}
if (listfff != null) {
Map listMap = listfff.get(i);
//获取ccc(用户名)
Integer ccc = (Integer) listMap.get("ccc");
//删除"ccc"
listMap.remove("ccc");
User user = map.getOrDefault(ccc.toString(), null);
//判断该用户是否创建过
if (user == null) {
//创建对象加入到list结果中
user = new User(ccc.toString(), aaa, flag);
resList.add(user);
map.put(ccc.toString(),user);
}
//获取到user中的Data数据
List<Infromation> data = user.getData();
//获取月份对照集合
Map<String, Integer> month = user.getMap();
//set为键值对对象
Set set = listMap.entrySet();
for (Object o : set) {
//强制转化为Entry对象
Map.Entry<String, String> entry = (Map.Entry<String, String>) o;
//获取到数据库中对应的月份
String target = listMap.getOrDefault(entry.getKey(), null).toString();
//不为空添加数据
if (target != null) {
//获取月份对应的下标
Integer index = month.get(entry.getKey());
//获取信息
Infromation infromation = data.get(index);
//原则上调用toString方法能解决,但是JIT自动优化了,只能使用上转型
Object value = entry.getValue();
infromation.setFff(value.toString());
}
}
}
if (listggg != null) {
Map listMap = listggg.get(i);
//获取ccc(用户名)
Integer ccc = (Integer) listMap.get("ccc");
//删除"ccc"
listMap.remove("ccc");
User user = map.getOrDefault(ccc.toString(), null);
//判断该用户是否创建过
if (user == null) {
//创建对象加入到list结果中
user = new User(ccc.toString(), aaa, flag);
resList.add(user);
map.put(ccc.toString(),user);
}
//获取到user中的Data数据
List<Infromation> data = user.getData();
//获取月份对照集合
Map<String, Integer> month = user.getMap();
//set为键值对对象
Set set = listMap.entrySet();
for (Object o : set) {
//强制转化为Entry对象
Map.Entry<String, String> entry = (Map.Entry<String, String>) o;
//获取到数据库中对应的月份
String target = listMap.getOrDefault(entry.getKey(), null).toString();
//不为空添加数据
if (target != null) {
//获取月份对应的下标
Integer index = month.get(entry.getKey());
//获取信息
Infromation infromation = data.get(index);
//原则上调用toString方法能解决,但是JIT自动优化了,只能使用上转型
Object value = entry.getValue();
infromation.setGgg(value.toString());
}
}
}
if (listjjj != null) {
Map listMap = listjjj.get(i);
//获取ccc(用户名)
Integer ccc = (Integer) listMap.get("ccc");
//删除"ccc"
listMap.remove("ccc");
User user = map.getOrDefault(ccc.toString(), null);
//判断该用户是否创建过
if (user == null) {
//创建对象加入到list结果中
user = new User(ccc.toString(), aaa, flag);
resList.add(user);
map.put(ccc.toString(),user);
}
//获取到user中的Data数据
List<Infromation> data = user.getData();
//获取月份对照集合
Map<String, Integer> month = user.getMap();
//set为键值对对象
Set set = listMap.entrySet();
for (Object o : set) {
//强制转化为Entry对象
Map.Entry<String, String> entry = (Map.Entry<String, String>) o;
//获取到数据库中对应的月份
String target = listMap.getOrDefault(entry.getKey(), null).toString();
//不为空添加数据
if (target != null) {
//获取月份对应的下标
Integer index = month.get(entry.getKey());
//获取信息
Infromation infromation = data.get(index);
//原则上调用toString方法能解决,但是JIT自动优化了,只能使用上转型
Object value = entry.getValue();
infromation.setJjj(value.toString());
}
}
}
}
return resList;
}
@Override
public List<DemoData1> getInformation(RequestInfromationDto requestInfromationDto) {
//设置查询值
String key = requestInfromationDto.getClickKey();
RequestInfromationDto.cleanAndBuild(requestInfromationDto,key);
//单独查询
List<DemoData1> data = mixSelectMapper.getInformation(requestInfromationDto);
return data;
}
@Override
public Integer getListTotal(RequestDto requestDto) {
//查询月份,不知道有啥用
List<String> monthsList = mixSelectMapper.getMonths();
String months = monthsList.stream()
// 将每个月份拼接成形如 "[yyyyMM]" 的字符串
.map(month -> "[" + month + "]")
// 使用逗号连接每个月份字符串
.collect(Collectors.joining(","));
List<Map> temp = null;
//获得返回数据长度
if (requestDto.isHhh()) {
temp = mixSelectMapper.getListhhhTotal(requestDto, months);
return temp.size();
} else if (requestDto.isIii()) {
temp = mixSelectMapper.getListiiiTotal(requestDto, months);
return temp.size();
} else if (requestDto.isKkk()) {
temp = mixSelectMapper.getListkkkTotal(requestDto, months);
return temp.size();
} else if (requestDto.isFff()) {
temp = mixSelectMapper.getListfffTotal(requestDto, months);
return temp.size();
} else if (requestDto.isGgg()) {
temp = mixSelectMapper.getListgggTotal(requestDto, months);
return temp.size();
}else {
temp = mixSelectMapper.getListjjjTotal(requestDto, months);
return temp.size();
}
}
@Override
public Integer getClickInformationPageNum(RequestInfromationDto requestInfromationDto) {
//设置查询值
String key = requestInfromationDto.getClickKey();
RequestInfromationDto.cleanAndBuild(requestInfromationDto,key);
//单独查询
Integer data = mixSelectMapper.getClickInformationPageNum(requestInfromationDto);
return data;
}
/**返回下拉数据*/
@Override
public List<DemoData1> searchAaa() {
return mixSelectMapper.searchAaa();
}
@Override
public List<DemoData1> searchCcc() {
return mixSelectMapper.searchCcc();
}
@Override
public List<DemoData1> searchCccc() {
return mixSelectMapper.searchCccc();
}
@Override
public List<DemoData1> searchEee() {
return mixSelectMapper.searchEee();
}
@Override
public List<DemoData1> searchBbb() {
return mixSelectMapper.searchBbb();
}
@Override
public List<DemoData1> searchDddd() {
return mixSelectMapper.searchDddd();
}
@Override
public List<DemoData1> searchDdd() {
return mixSelectMapper.searchDdd();
}
@Override
public List<DemoData1> searchNqy() {
return mixSelectMapper.searchNqy();
}
@Override
public List<DemoData1> searchKhqf() {
return mixSelectMapper.searchKhqf();
}
@Override
public List<DemoData1> searchJlpm() {
return mixSelectMapper.searchJlpm();
}
}
<?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="org.rcisoft.bus.mixSelect.dao.MixSelectMapper">
<select id="test" resultType="java.lang.Object">
SELECT ccc, aaa, SUM ( hhh ) AS total FROM demo WHERE ccc IS NOT NULL GROUP BY ccc, aaa
</select>
<select id="getListhhh" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(hhh) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
ORDER BY ccc
OFFSET (#{pageNo} - 1) * #{pageSize} ROWS
FETCH NEXT #{pageSize} ROWS ONLY
</select>
<select id="getListkkk" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(kkk) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
ORDER BY ccc
OFFSET (#{pageNo} - 1) * #{pageSize} ROWS
FETCH NEXT #{pageSize} ROWS ONLY
</select>
<select id="getListiii" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(iii) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
ORDER BY ccc
OFFSET (#{pageNo} - 1) * #{pageSize} ROWS
FETCH NEXT #{pageSize} ROWS ONLY
</select>
<select id="getListfff" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(fff) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
ORDER BY ccc
OFFSET (#{pageNo} - 1) * #{pageSize} ROWS
FETCH NEXT #{pageSize} ROWS ONLY
</select>
<select id="getListggg" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(ggg) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
ORDER BY ccc
OFFSET (#{pageNo} - 1) * #{pageSize} ROWS
FETCH NEXT #{pageSize} ROWS ONLY
</select>
<select id="getListjjj" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(jjj) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
ORDER BY ccc
OFFSET (#{pageNo} - 1) * #{pageSize} ROWS
FETCH NEXT #{pageSize} ROWS ONLY
</select>
<select id="getListhhhTotal" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(hhh) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
</select>
<select id="getListkkkTotal" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(kkk) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
</select>
<select id="getListiiiTotal" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(iii) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
</select>
<select id="getListfffTotal" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(fff) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
</select>
<select id="getListgggTotal" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(ggg) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
</select>
<select id="getListjjjTotal" resultType="java.util.Map">
SELECT *
FROM (
SELECT ccc,
aaa ,
SUM(jjj) AS total
FROM demo
WHERE ccc IS NOT NULL
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY ccc, aaa
)
AS SourceTable
PIVOT
( SUM(total) FOR aaa IN
(
${monthList}
)
)
AS PivotTable
</select>
<select id="getMonths" resultType="java.lang.String">
SELECT aaa
FROM (
SELECT DISTINCT aaa, CAST(aaa AS INT) AS month_order
FROM demo
) AS subquery
ORDER BY month_order ASC
</select>
<select id="getInformation" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT *
FROM demo d
WHERE ccc = #{entity.clickCcc}
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY business_id
OFFSET (#{entity.pageNo} - 1) * #{entity.pageSize} ROWS
FETCH NEXT #{entity.pageSize} ROWS ONLY
</select>
<select id="getClickInformationPageNum" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM demo d
WHERE ccc = #{entity.clickCcc}
<if test="entity.aaa != null and entity.aaa.size() != 0">
and aaa in
<foreach item="item" index="index" collection="entity.aaa" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ccc != null and entity.ccc.size() != 0">
and ccc in
<foreach item="item" index="index" collection="entity.ccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.eee != null and entity.eee.size() != 0">
and eee in
<foreach item="item" index="index" collection="entity.eee" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.cccc != null and entity.cccc.size() != 0">
and cccc in
<foreach item="item" index="index" collection="entity.cccc" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.bbb != null and entity.bbb.size() != 0">
and bbb in
<foreach item="item" index="index" collection="entity.bbb" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.ddd != null and entity.ddd.size() != 0">
and ddd in
<foreach item="item" index="index" collection="entity.ddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entity.dddd != null and entity.dddd.size() != 0">
and dddd in
<foreach item="item" index="index" collection="entity.dddd" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="searchAaa" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT DISTINCT aaa AS month
FROM demo
</select>
<select id="searchCcc" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT DISTINCT ccc
FROM demo
</select>
<select id="searchCccc" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT DISTINCT cccc
FROM demo
</select>
<select id="searchEee" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT DISTINCT eee
FROM demo
</select>
<select id="getMonthsFromDB" resultType="java.lang.String">
SELECT aaa
FROM (
SELECT DISTINCT aaa, CAST(aaa AS INT) AS month_order
FROM demo
) AS subquery
ORDER BY month_order ASC
</select>
<select id="searchDddd" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT DISTINCT dddd
FROM demo
</select>
<select id="searchDdd" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT DISTINCT Ddd
FROM demo
</select>
<select id="searchBbb" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT DISTINCT bbb
FROM demo
</select>
<select id="searchNqy" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT DISTINCT nqy AS month
FROM jnsp7xtm
</select>
<select id="searchKhqf" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
select distinct khqf from jnsp7xtm
</select>
<select id="searchJlpm" resultType="org.rcisoft.bus.mixSelect.entity.DemoData1">
SELECT DISTINCT jlpm
FROM jnsp7xtm
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment