This commit is contained in:
wans 2020-11-03 17:46:50 +08:00
parent 4f27b7dd5a
commit 159c8544e7
7 changed files with 101 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList; import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO; import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonEChartsDTO;
import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO; import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO;
import com.cm.partybuilding.service.threemeetlesson.IThreeMeetLessonService; import com.cm.partybuilding.service.threemeetlesson.IThreeMeetLessonService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ -111,6 +112,14 @@ public class ThreeMeetLessonController extends AbstractController {
return threeMeetLessonService.countThreeMeetLesson(params); return threeMeetLessonService.countThreeMeetLesson(params);
} }
@ApiOperation(value = "三会一课数量降序统计", notes = "三会一课数量降序统计接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("countthreemeetlessondesc")
SuccessResultData<List<ThreeMeetLessonDTO>> countThreeMeetLessonDesc() throws SearchException {
Map<String, Object> params = requestParams();
return threeMeetLessonService.countThreeMeetLessonDesc(params);
}
@ApiOperation(value = "当前用户id信息", notes = "当前用户id信息接口") @ApiOperation(value = "当前用户id信息", notes = "当前用户id信息接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("getcurrentuseridinfo") @GetMapping("getcurrentuseridinfo")

View File

@ -6,6 +6,7 @@ import com.cm.common.exception.SearchException;
import com.cm.common.exception.UpdateException; import com.cm.common.exception.UpdateException;
import com.cm.common.result.SuccessResultList; import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO; import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonEChartsDTO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
@ -80,4 +81,10 @@ public interface IThreeMeetLessonDao {
*/ */
Integer countThreeMeetLesson(Map<String, Object> params) throws SearchException; Integer countThreeMeetLesson(Map<String, Object> params) throws SearchException;
/**
* 三会一课图表
* @param params
* @return
*/
List<ThreeMeetLessonDTO> countThreeMeetLessonDesc(Map<String, Object> params);
} }

View File

@ -36,6 +36,8 @@ public class ThreeMeetLessonDTO {
private String category; private String category;
@ApiModelProperty(name = "categoryName", value = "类别名称") @ApiModelProperty(name = "categoryName", value = "类别名称")
private String categoryName; private String categoryName;
@ApiModelProperty(name = "counts", value = "数量")
private Integer counts;
public String getThreeMeetLessonId() { public String getThreeMeetLessonId() {
return threeMeetLessonId == null ? "" : threeMeetLessonId; return threeMeetLessonId == null ? "" : threeMeetLessonId;
@ -124,4 +126,12 @@ public class ThreeMeetLessonDTO {
public void setCategoryName(String categoryName) { public void setCategoryName(String categoryName) {
this.categoryName = categoryName; this.categoryName = categoryName;
} }
public Integer getCounts() {
return counts;
}
public void setCounts(Integer counts) {
this.counts = counts;
}
} }

View File

@ -0,0 +1,43 @@
package com.cm.partybuilding.pojo.dtos.threemeetlesson;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
/**
* @author xwangs
* @create 2020-10-23 16:43
* @description
*/
@ApiModel
public class ThreeMeetLessonEChartsDTO {
@ApiModelProperty(name = "categoryNames", value = "三会一课课程名字")
private List<String> categoryNames;
@ApiModelProperty(name = "counts", value = "开展会议的数量")
private List<Integer> counts;
public List<String> getCategoryNames() {
if (categoryNames == null) {
return new ArrayList<>();
}
return categoryNames;
}
public void setCategoryNames(List<String> categoryNames) {
this.categoryNames = categoryNames;
}
public List<Integer> getCounts() {
if (counts == null) {
return new ArrayList<>();
}
return counts;
}
public void setCounts(List<Integer> counts) {
this.counts = counts;
}
}

View File

@ -8,6 +8,7 @@ import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList; import com.cm.common.result.SuccessResultList;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO; import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonEChartsDTO;
import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO; import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO;
import java.util.List; import java.util.List;
@ -153,4 +154,10 @@ public interface IThreeMeetLessonService {
*/ */
SuccessResultData<Integer> countThreeMeetLesson(Map<String, Object> params) throws SearchException; SuccessResultData<Integer> countThreeMeetLesson(Map<String, Object> params) throws SearchException;
/**
* 三会一课图表
* @param params
* @return
*/
SuccessResultData<List<ThreeMeetLessonDTO>> countThreeMeetLessonDesc(Map<String, Object> params);
} }

View File

@ -11,6 +11,7 @@ import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil; import com.cm.common.utils.UUIDUtil;
import com.cm.partybuilding.dao.threemeetlesson.IThreeMeetLessonDao; import com.cm.partybuilding.dao.threemeetlesson.IThreeMeetLessonDao;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO; import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonDTO;
import com.cm.partybuilding.pojo.dtos.threemeetlesson.ThreeMeetLessonEChartsDTO;
import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO; import com.cm.partybuilding.pojo.vos.threemeetlesson.ThreeMeetLessonVO;
import com.cm.partybuilding.service.threemeetlesson.IThreeMeetLessonService; import com.cm.partybuilding.service.threemeetlesson.IThreeMeetLessonService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -18,6 +19,7 @@ import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -183,6 +185,12 @@ public class ThreeMeetLessonServiceImpl extends AbstractService implements IThre
return count == null ? 0 : count; return count == null ? 0 : count;
} }
@Override
public SuccessResultData<List<ThreeMeetLessonDTO>> countThreeMeetLessonDesc(Map<String, Object> params) {
List<ThreeMeetLessonDTO> dtos = threeMeetLessonDao.countThreeMeetLessonDesc(params);
return new SuccessResultData<>(dtos);
}
@Override @Override
public SuccessResultData<Integer> countThreeMeetLesson(Map<String, Object> params) throws SearchException { public SuccessResultData<Integer> countThreeMeetLesson(Map<String, Object> params) throws SearchException {
return new SuccessResultData<>(countNumberThreeMeetLesson(params)); return new SuccessResultData<>(countNumberThreeMeetLesson(params));

View File

@ -14,6 +14,7 @@
<result column="files" property="files"/> <result column="files" property="files"/>
<result column="category" property="category"/> <result column="category" property="category"/>
<result column="category_name" property="categoryName"/> <result column="category_name" property="categoryName"/>
<result column="counts" property="counts"/>
</resultMap> </resultMap>
<!-- 新增 --> <!-- 新增 -->
@ -195,4 +196,20 @@
t1.is_delete = 0 t1.is_delete = 0
</select> </select>
<!--三会一课降序-->
<select id="countThreeMeetLessonDesc" parameterType="map" resultMap="threeMeetLessonDTO">
SELECT
t1.category_name,
count(t1.category) counts
FROM
gen_three_meet_lesson t1
WHERE
t1.is_delete = '0'
<if test="category !=null and category != ''">
AND t1.category = #{category}
</if>
GROUP BY
t1.category
ORDER BY counts DESC
</select>
</mapper> </mapper>