From 01a21547d81ceeb70d9a7a95045c99f2e7294174 Mon Sep 17 00:00:00 2001 From: ic_excellent Date: Thu, 16 Feb 2023 14:56:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E6=97=B6=E6=8D=B7=E5=B9=B4=E7=BB=88?= =?UTF-8?q?=E6=80=BB=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/YearReviewController.java | 157 +++++++++++++++ .../porsche_review/mapper/ReviewMapper.java | 182 ++++++++++++++++++ .../porsche_review/service/ReviewService.java | 77 ++++++++ .../service/impl/ReviewServiceImpl.java | 113 +++++++++++ src/test/java/bokang/xiao/NormalTest.java | 77 ++++++++ .../java/bokang/xiao/mapper/TestMapper.java | 28 +++ 6 files changed, 634 insertions(+) create mode 100644 src/main/java/com/api/bokang/xiao/porsche_review/controller/YearReviewController.java create mode 100644 src/main/java/com/api/bokang/xiao/porsche_review/mapper/ReviewMapper.java create mode 100644 src/main/java/com/api/bokang/xiao/porsche_review/service/ReviewService.java create mode 100644 src/main/java/com/api/bokang/xiao/porsche_review/service/impl/ReviewServiceImpl.java create mode 100644 src/test/java/bokang/xiao/NormalTest.java create mode 100644 src/test/java/bokang/xiao/mapper/TestMapper.java diff --git a/src/main/java/com/api/bokang/xiao/porsche_review/controller/YearReviewController.java b/src/main/java/com/api/bokang/xiao/porsche_review/controller/YearReviewController.java new file mode 100644 index 0000000..7c1a9a8 --- /dev/null +++ b/src/main/java/com/api/bokang/xiao/porsche_review/controller/YearReviewController.java @@ -0,0 +1,157 @@ +package com.api.bokang.xiao.porsche_review.controller; + +import aiyh.utils.ApiResult; +import aiyh.utils.Util; +import aiyh.utils.zwl.common.ToolUtil; +import com.api.bokang.xiao.porsche_review.service.ReviewService; +import com.api.bokang.xiao.porsche_review.service.impl.ReviewServiceImpl; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import org.apache.log4j.Logger; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.List; +import java.util.Map; + + +/** + * @ClassName YearReviewController + * @Author 肖博亢 + * @Date 2023/2/14 17:00 + * @Description

保时捷年终总结相关接口

+ **/ +@Path("/xbk/porsche_review") +public class YearReviewController { + + private final Logger log = Util.getLogger(); + ReviewService reviewService = new ReviewServiceImpl(); + + /** 需要排除的流程id */ + private final String workflowIds = new ToolUtil().getSystemParamValue("workflowIds"); + + /** 建模表表名及字段 */ + private final String modelTables = new ToolUtil().getSystemParamValue("modelTables"); + + /** + *

获取创建或处理流程的总数

+ * @param request 请求体 + * @param response 响应体 + * @param param 请求参数 + * @return 请求结果 + */ + @Path("/getCreateOrOperateCount") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getCreateOrOperateCount(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map param) { + try{ + log.info("into getCreateOrOperateCount success params ==> "+param); + User loginUser = HrmUserVarify.getUser(request, response); + String type = Util.null2String(param.get("type")); + param.put("workflowIds",workflowIds); + Map data = "create".equals(type) ? reviewService.getCreateCount(param,loginUser) : reviewService.getDealCount(param,loginUser); + return ApiResult.success(data); + }catch (Exception e){ + log.error("获取创建或处理流程的总数异常 ==> "+Util.getErrString(e)); + return ApiResult.error(e.getMessage()); + } + } + + /** + *

获取流程的总数

+ * @param request 请求体 + * @param response 响应体 + * @param param 请求参数 + * @return 请求结果 + */ + @Path("/getTotalCount") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getTotalCount(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map param) { + try{ + log.info("into getTotalCount success params ==> "+param); + param.put("workflowIds",workflowIds); + int totalCount = reviewService.getTotalCount(param); + return ApiResult.success(totalCount); + }catch (Exception e){ + log.error("获取流程总数异常 ==> "+Util.getErrString(e)); + return ApiResult.error(e.getMessage()); + } + } + + /** + *

获取电子章的总数

+ * @param request 请求体 + * @param response 响应体 + * @param param 请求参数 + * @return 请求结果 + */ + @Path("/getElectronicSealCount") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getElectronicSealCount(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map param) { + try{ + param.put("modelTables",modelTables); + int count = reviewService.getElectronicSealCount(param); + return ApiResult.success(count); + }catch (Exception e){ + log.error("获取电子章总数异常 ==> "+Util.getErrString(e)); + return ApiResult.error(e.getMessage()); + } + } + + /** + *

获取创建或处理流程的总数

+ * @param request 请求体 + * @param response 响应体 + * @param param 请求参数 + * @return 请求结果 + */ + @Path("/getWorkflowTop5") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getWorkflowTop5(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map param) { + try{ + log.info("into getWorkflowTop5 success params ==> "+param); + User loginUser = HrmUserVarify.getUser(request, response); + param.put("workflowIds",workflowIds); + String type = Util.null2String(param.get("type")); + List> data = "create".equals(type) ? reviewService.getCreateTop5(param, loginUser) : reviewService.getOperateTop5(param, loginUser); + return ApiResult.success(data); + }catch (Exception e){ + log.error("获取创建或处理流程总数异常 ==> "+Util.getErrString(e)); + return ApiResult.error(e.getMessage()); + } + } + + /** + *

获取创建或处理流程的总数

+ * @param request 请求体 + * @param response 响应体 + * @param param 请求参数 + * @return 请求结果 + */ + @Path("/getTopDate") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String getTopDate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map param) { + try{ + log.info("into getTopDate success params ==> "+param); + User loginUser = HrmUserVarify.getUser(request, response); + param.put("workflowIds",workflowIds); + String type = Util.null2String(param.get("type")); + String date = "create".equals(type) ? reviewService.getCreateTopDate(param, loginUser) : reviewService.getOperateTopDate(param, loginUser); + return ApiResult.success(date); + }catch (Exception e){ + log.error("获取创建或处理流程总数异常 ==> "+Util.getErrString(e)); + return ApiResult.error(e.getMessage()); + } + } + +} diff --git a/src/main/java/com/api/bokang/xiao/porsche_review/mapper/ReviewMapper.java b/src/main/java/com/api/bokang/xiao/porsche_review/mapper/ReviewMapper.java new file mode 100644 index 0000000..6f66253 --- /dev/null +++ b/src/main/java/com/api/bokang/xiao/porsche_review/mapper/ReviewMapper.java @@ -0,0 +1,182 @@ +package com.api.bokang.xiao.porsche_review.mapper; + +import aiyh.utils.annotation.recordset.ParamMapper; +import aiyh.utils.annotation.recordset.Select; +import aiyh.utils.annotation.recordset.SqlMapper; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName ReviewMapper + * @Author 肖博亢 + * @Date 2023/2/14 17:02 + * @Description

+ **/ +@SqlMapper +public interface ReviewMapper { + + /** + *

查询用户创建流程的总数

+ * @param uid 用户id + * @param param 参数信息 + * @return 创建流程的数量 + */ + @Select("select count(*) from workflow_requestbase where creater = #{uid} " + + "and (createdate between #{param.startDate} and #{param.endDate}) and workflowid not in (${param.workflowIds})") + int queryCreateCount(@ParamMapper("param") Map param,@ParamMapper("uid") int uid); + + /** + *

查询流程的总数

+ * @param param 参数信息 + * @return 创建流程的数量 + */ + @Select("select count(*) from workflow_requestbase " + + "where (createdate between #{startDate} and #{endDate}) and workflowid not in (${workflowIds})") + int queryTotalCount(Map param); + + /** + *

查询用户总数

+ * @param param 条件参数 + * @return 人员总数 + */ + @Select("select count(*) from hrmresource") + int queryResourceCount(Map param); + + /** + *

查询排名信息

+ * @param uid 用户id + * @param param 参数信息 + * @return 排名 + */ + @Select("select @row := @row + 1 as rowindex " + + "from ( " + + " select " + + " creater,count(*) wcount " + + " from workflow_requestbase wrb " + + " where createdate between #{param.startDate} and #{param.endDate} " + + " and workflowid not in (${param.workflowIds})" + + " group by creater " + + " order by wcount desc " + + ") w,(SELECT @row := 0) t " + + "where creater = #{uid}") + int queryRankingMsg(@ParamMapper("param") Map param,@ParamMapper("uid") int uid); + + /** + *

查询用户操作流程数量的排名

+ * @param param 参数信息 + * @param uid 用户id + * @return 排名 + */ + @Select("select @row := @row + 1 as rowindex " + + "from " + + "( " + + " select " + + " wfo.operatorid,count(*) wcount " + + " from workflow_requestoperatelog wfo " + + " inner join workflow_requestbase wrb on wfo.requestid = wrb.requestid " + + " inner join workflow_base wb on wrb.workflowid = wb.id " + + " inner join workflow_nodebase wnb on wfo.nodeid = wnb.id " + + " where (wfo.operatorid <> wrb.creater || (wfo.operatorid = wrb.creater && wnb.isstart <> 1)) " + + " and (wfo.operatedate between #{param.startDate} and #{param.endDate}) and workflowid not in (${param.workflowIds})" + + " group by operatorid " + + " order by wcount desc " + + ")w,(SELECT @row := 0) t where w.operatorid = #{uid}") + int queryOperateRankingMsg(@ParamMapper("param") Map param,@ParamMapper("uid") int uid); + + /** + *

查询处理流程总数

+ * @param uid 用户id + * @param param 参数信息 + * @return 用户处理流程总数 + */ + @Select("select " + + "count(*) " + + "from workflow_requestoperatelog wfo " + + "inner join workflow_requestbase wrb on wfo.requestid = wrb.requestid " + + "inner join workflow_nodebase wnb on wfo.nodeid = wnb.id " + + "where (wfo.operatorid <> wrb.creater || (wfo.operatorid = wrb.creater && wnb.isstart <> 1)) " + + " and (wfo.operatedate between #{param.startDate} and #{param.endDate}) and wfo.operatorid = #{uid} and workflowid not in (${param.workflowIds})") + int queryDealCount(@ParamMapper("param") Map param,@ParamMapper("uid") int uid); + + /** + *

查询用户创建流程top5

+ * @param uid 用户id + * @param param 参数信息 + * @return 前五条流程数据 + */ + @Select("select distinct workflowid workflowId,workflowname workflowName,count(*) wcount " + + "from workflow_requestbase wr " + + "inner join workflow_base wb on wr.workflowid = wb.id " + + "where wr.creater = #{uid} and (createdate between #{param.startDate} and #{param.endDate}) " + + " and workflowid not in (${param.workflowIds})" + + "group by workflowid " + + "ORDER BY wcount " + + "limit 5") + List> queryCreateTop5(@ParamMapper("param") Map param,@ParamMapper("uid") int uid); + + /** + *

获取用户操作流程top5

+ * @param param 请求参数 + * @param uid 用户id + * @return 前五条流程数据 + */ + @Select("select " + + " wrb.workflowid,wb.workflowname,count(*) wcount " + + "from workflow_requestoperatelog wfo " + + "inner join workflow_requestbase wrb on wfo.requestid = wrb.requestid " + + "inner join workflow_base wb on wrb.workflowid = wb.id " + + "inner join workflow_nodebase wnb on wfo.nodeid = wnb.id " + + "where (wfo.operatorid <> wrb.creater || (wfo.operatorid = wrb.creater && wnb.isstart <> 1)) " + + " and (wfo.operatedate between #{param.startDate} and #{param.endDate}) " + + " and operatorid = #{uid} and workflowid not in (${param.workflowIds}) " + + "group by workflowid " + + "order by wcount desc " + + "limit 5") + List> queryOperateTop5(@ParamMapper("param") Map param,@ParamMapper("uid") int uid); + + /** + *

查询创建流程最多的一天

+ * @param param 参数信息 + * @param uid 用户id + * @return 日期 + */ + @Select("select createdate from workflow_requestbase " + + " where creater = #{uid} and (createdate between #{param.startDate} and #{param.endDate}) " + + " and workflowid not in (${param.workflowIds}) " + + " group by createdate " + + " order by count(*) desc " + + " limit 1") + String queryCreateTopDate(@ParamMapper("param") Map param,@ParamMapper("uid") int uid); + + /** + *

查询操作流程最多的一天

+ * @param param 参数信息 + * @param uid 用户id + * @return 日期 + */ + @Select("select operatedate " + + "from workflow_requestoperatelog wfo " + + "inner join workflow_requestbase wrb on wfo.requestid = wrb.requestid " + + "inner join workflow_base wb on wrb.workflowid = wb.id " + + "inner join workflow_nodebase wnb on wfo.nodeid = wnb.id " + + "where (wfo.operatorid <> wrb.creater || (wfo.operatorid = wrb.creater && wnb.isstart <> 1)) " + + " and (wfo.operatedate between #{param.startDate} and #{param.endDate}) " + + " and operatorid = #{uid} and workflowid not in (${param.workflowIds}) " + + "group by operatedate " + + "order by count(*) desc " + + "limit 1") + String queryOperateTopDate(@ParamMapper("param") Map param,@ParamMapper("uid") int uid); + + /** + *

通过条件查询数量

+ * @param tableName 表名 + * @param fieldName 字段名 + * @param fieldValue 字段值 + * @return 数量 + */ + @Select("select count(*) from $t{tableName} where $t{fieldName} = #{fieldValue}") + int queryCountByParam(@ParamMapper("tableName") String tableName, + @ParamMapper("fieldName") String fieldName, + @ParamMapper("fieldValue") String fieldValue); +} diff --git a/src/main/java/com/api/bokang/xiao/porsche_review/service/ReviewService.java b/src/main/java/com/api/bokang/xiao/porsche_review/service/ReviewService.java new file mode 100644 index 0000000..af785fa --- /dev/null +++ b/src/main/java/com/api/bokang/xiao/porsche_review/service/ReviewService.java @@ -0,0 +1,77 @@ +package com.api.bokang.xiao.porsche_review.service; + +import weaver.hrm.User; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName ReviewService + * @Author 肖博亢 + * @Date 2023/2/14 17:01 + * @Description

+ **/ +public interface ReviewService { + + /** + *

获取用户创建流程的总数

+ * @param param 参数信息 + * @param user 登录用户 + * @return 查询结果 + */ + Map getCreateCount(Map param, User user); + + /** + *

获取用户处理流程的总数

+ * @param param 参数信息 + * @param user 登录用户 + * @return 查询结果 + */ + Map getDealCount(Map param, User user); + + /** + *

获取创建流程数量top5

+ * @param param 请求参数 + * @param user 用户信息 + * @return 前五条流程数据 + */ + List> getCreateTop5(Map param, User user); + + /** + *

获取操作流程数量top5

+ * @param param 请求参数 + * @param user 用户信息 + * @return 前五条流程数据 + */ + List> getOperateTop5(Map param, User user); + + /** + *

获取创建流程最多的一天

+ * @param param 参数信息 + * @param loginUser 用户信息 + * @return 日期 + */ + String getCreateTopDate(Map param, User loginUser); + + /** + *

获取操作流程最多的一天

+ * @param param 参数信息 + * @param loginUser 用户信息 + * @return 日期 + */ + String getOperateTopDate(Map param, User loginUser); + + /** + *

获取流程的总数

+ * @param param 参数信息 + * @return 查询结果 + */ + int getTotalCount(Map param); + + /** + *

获取电子章的总数

+ * @param param 参数信息 + * @return 查询结果 + */ + int getElectronicSealCount(Map param); +} diff --git a/src/main/java/com/api/bokang/xiao/porsche_review/service/impl/ReviewServiceImpl.java b/src/main/java/com/api/bokang/xiao/porsche_review/service/impl/ReviewServiceImpl.java new file mode 100644 index 0000000..2237aac --- /dev/null +++ b/src/main/java/com/api/bokang/xiao/porsche_review/service/impl/ReviewServiceImpl.java @@ -0,0 +1,113 @@ +package com.api.bokang.xiao.porsche_review.service.impl; + +import aiyh.utils.Util; +import com.api.bokang.xiao.porsche_review.mapper.ReviewMapper; +import com.api.bokang.xiao.porsche_review.service.ReviewService; +import weaver.hrm.User; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @ClassName ReviewServiceImpl + * @Author 肖博亢 + * @Date 2023/2/14 17:02 + * @Description

+ **/ +public class ReviewServiceImpl implements ReviewService { + + private final ReviewMapper reviewMapper = Util.getMapper(ReviewMapper.class); + + private Integer resourceCount = 0; + + @Override + public Map getCreateCount(Map param, User user) { + Map res = new HashMap<>(); + int createCount = reviewMapper.queryCreateCount(param,user.getUID()); + int ranking = reviewMapper.queryRankingMsg(param,user.getUID()); + resourceCount = resourceCount > 0 ? resourceCount : reviewMapper.queryResourceCount(new HashMap<>()); + double exceed = 1 - (1.00*ranking/resourceCount); + res.put("totalCount",createCount); + res.put("exceed",exceed); + return res; + } + + @Override + public Map getDealCount(Map param, User user) { + Map res = new HashMap<>(); + int operateCount = reviewMapper.queryDealCount(param, user.getUID()); + resourceCount = resourceCount > 0 ? resourceCount : reviewMapper.queryResourceCount(new HashMap<>()); + int rankingMsg = reviewMapper.queryOperateRankingMsg(param, user.getUID()); + double exceed = 1 - (1.00*rankingMsg/resourceCount); + res.put("totalCount",operateCount); + res.put("exceed",exceed); + return res; + } + + @Override + public List> getCreateTop5(Map param, User user) { + return reviewMapper.queryCreateTop5(param,user.getUID()); + } + + @Override + public List> getOperateTop5(Map param, User user) { + return reviewMapper.queryOperateTop5(param,user.getUID()); + } + + @Override + public String getCreateTopDate(Map param, User loginUser) { + return reviewMapper.queryCreateTopDate(param,loginUser.getUID()); + } + + @Override + public String getOperateTopDate(Map param, User loginUser) { + return reviewMapper.queryOperateTopDate(param,loginUser.getUID()); + } + + @Override + public int getTotalCount(Map param) { + return reviewMapper.queryTotalCount(param); + } + + @Override + public int getElectronicSealCount(Map param) { + String modelTables = Util.null2String(param.get("modelTables")); + int totalCount = 0; + Map> modelTableMap = getModelTables(modelTables); + for (Map.Entry> entry : modelTableMap.entrySet()) { + String tableName = entry.getKey(); + Map fieldMap = entry.getValue(); + String fieldName = Util.null2String(fieldMap.get("fieldName")); + String fieldValue = Util.null2String(fieldMap.get("fieldValue")); + int count = reviewMapper.queryCountByParam(tableName, fieldName, fieldValue); + totalCount += count; + } + return totalCount; + } + + /** + *

获取建模表及其唯一字段

+ * @param sourceStr 原有表名字符串 + * @return 表名集合 + */ + public Map> getModelTables(String sourceStr){ + Map> modelTableMap = new HashMap<>(); + String regx = "\\{(?\\S+):(?\\S+):(?\\S+)}"; + Pattern compile = Pattern.compile(regx); + Matcher matcher = compile.matcher(sourceStr); + while (matcher.find()){ + String tableName = matcher.group("tableName"); + String fieldName = matcher.group("fieldName"); + String fieldValue = matcher.group("fieldValue"); + Map fieldMap = new HashMap<>(); + fieldMap.put("fieldName",fieldName); + fieldMap.put("fieldValue",fieldValue); + modelTableMap.put(tableName,fieldMap); + } + return modelTableMap; + } + +} diff --git a/src/test/java/bokang/xiao/NormalTest.java b/src/test/java/bokang/xiao/NormalTest.java new file mode 100644 index 0000000..9200826 --- /dev/null +++ b/src/test/java/bokang/xiao/NormalTest.java @@ -0,0 +1,77 @@ +package bokang.xiao; + +import aiyh.utils.Util; +import aiyh.utils.httpUtil.ResponeVo; +import aiyh.utils.httpUtil.util.HttpUtils; +import basetest.BaseTest; +import bokang.xiao.mapper.TestMapper; +import com.api.bokang.xiao.porsche_review.mapper.ReviewMapper; +import com.api.bokang.xiao.porsche_review.service.impl.ReviewServiceImpl; +import org.apache.log4j.Logger; +import org.junit.Test; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @ClassName NormalTest + * @Author 肖博亢 + * @Date 2023/2/13 13:48 + * @Description

+ **/ +public class NormalTest extends BaseTest { + + @Test + public void testWord(){ + + } + + @Test + public void testQuery(){ + TestMapper mapper = Util.getMapper(TestMapper.class); + List> query = mapper.query(); + System.out.println(query); + } + + @Test + public void testWorkflowQuery(){ + ReviewMapper reviewMapper = Util.getMapper(ReviewMapper.class); + Map param = new HashMap<>(); + param.put("startDate","2022-01-09"); + param.put("endDate","2023-04-09"); + param.put("workflowIds","0"); + String s1 = reviewMapper.queryCreateTopDate(param, 1); + System.out.println(s1); + } + + @Test + public void testRequest() throws IOException { + HttpUtils httpUtils = new HttpUtils(); + Map param = new HashMap<>(); + param.put("grant_type","client_credentials"); + param.put("client_id","95c7211b-31dd-4fe9-87d2-35ad5ab6c76c"); + param.put("client_secret","Nri.W_2-bGP6H1FmorFi~3T7_-e91FSrYR"); + param.put("scope","api://95c7211b-31dd-4fe9-87d2-35ad5ab6c76c/.default"); + ResponeVo responeVo = httpUtils.apiPost("https://login.partner.microsoftonline.cn/875412dd-d33b-4ee0-a8a0-7133237e3c98/oauth2/v2.0/token", param); + Map entity = responeVo.getResponseEntity(Map.class); + System.out.println(entity); + + Object access_token = entity.get("access_token"); + + Map requestParam = new HashMap<>(); + requestParam.put("queryType","AC"); + requestParam.put("startDateTime","2022-11-01"); + //requestParam.put("endDateTime","2022-11-21"); + requestParam.put("page",1); + requestParam.put("limit",200); + Map heareds = new HashMap<>(); + heareds.put("Authorization",Util.null2String(access_token)); + ResponeVo responeVo1 = httpUtils.apiPost("https://chinaapi-uat.elcompanies.cn/api/in/out/masterdata/product/v1/list", requestParam, heareds); + Map responseEntity = responeVo1.getResponseEntity(Map.class); + System.out.println(responseEntity); + + } + +} diff --git a/src/test/java/bokang/xiao/mapper/TestMapper.java b/src/test/java/bokang/xiao/mapper/TestMapper.java new file mode 100644 index 0000000..b7cf12c --- /dev/null +++ b/src/test/java/bokang/xiao/mapper/TestMapper.java @@ -0,0 +1,28 @@ +package bokang.xiao.mapper; + +import aiyh.utils.annotation.recordset.Select; +import aiyh.utils.annotation.recordset.SqlMapper; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName TestMapper + * @Author 肖博亢 + * @Date 2023/2/14 16:24 + * @Description

+ **/ + +@SqlMapper +public interface TestMapper { + + @Select("select w.*,@row := @row + 1 as rowindex\n" + + "from (\n" + + "select \n" + + " \tcreater,count(*) wcount\n" + + "from workflow_requestbase wrb\n" + + "group by creater\n" + + "order by wcount desc\n" + + ") w,(SELECT @row := 0) t") + List> query(); +}