初始化后端接口

飞书小程序
YXY 1 year ago
parent fdfada1c7a
commit 56f531f17e

@ -1,9 +1,14 @@
package com.ruoyi.flyingbook.controller; package com.ruoyi.flyingbook.controller;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.enums.LarkActiveStageEnum;
import com.ruoyi.flyingbook.domain.LarkActive; import com.ruoyi.flyingbook.domain.LarkActive;
import com.ruoyi.flyingbook.domain.LarkUserActiveInviteRelatoin;
import com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin;
import com.ruoyi.flyingbook.domain.edi.ResponseVo; import com.ruoyi.flyingbook.domain.edi.ResponseVo;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveCountVo;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveRequest; import com.ruoyi.flyingbook.domain.larkactive.LarkActiveRequest;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveUserRelationRequest;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveVo; import com.ruoyi.flyingbook.domain.larkactive.LarkActiveVo;
import com.ruoyi.flyingbook.service.ILarkActiveService; import com.ruoyi.flyingbook.service.ILarkActiveService;
import com.ruoyi.flyingbook.service.ILarkUserActiveInviteRelatoinService; import com.ruoyi.flyingbook.service.ILarkUserActiveInviteRelatoinService;
@ -14,6 +19,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Slf4j @Slf4j
@RestController @RestController
public class LarkActiveController extends BaseController { public class LarkActiveController extends BaseController {
@ -34,11 +41,11 @@ public class LarkActiveController extends BaseController {
} }
/** /**
* id todo yxy * id
*/ */
@PostMapping("/getAcitveById") @PostMapping("/getAcitveById")
public ResponseVo<LarkActiveVo> getAcitveById(@RequestBody LarkActiveRequest request) { public ResponseVo<LarkActiveVo> getAcitveById(@RequestBody LarkActiveRequest request) {
LarkActive larkActive = larkActiveService.selectLarkActiveById(request.getLarkActiveId()); LarkActive larkActive = larkActiveService.getActiveInfo(request);
return new ResponseVo(larkActive); return new ResponseVo(larkActive);
} }
@ -52,40 +59,60 @@ public class LarkActiveController extends BaseController {
} }
/** /**
* todo yxy *
*/ */
@PostMapping("/queryWaitReview") @PostMapping("/queryWaitReview")
public ResponseVo<String> queryWaitReview() { public ResponseVo<LarkUserActiveRelatoin> queryWaitReview(@RequestBody LarkActiveUserRelationRequest request) {
return new ResponseVo(); request.setActiveStage(LarkActiveStageEnum.SUBMIT.getCode());
return larkUserActiveRelatoinService.queryPage(request);
}
/**
*
*/
@PostMapping("/approve")
public void approve(@RequestBody LarkUserActiveRelatoin request) {
request.setActiveStage(LarkActiveStageEnum.ADJUST.getCode());
larkUserActiveRelatoinService.updateLarkUserActiveRelatoin(request);
} }
/** /**
* todo yxy *
*/ */
@PostMapping("/queryCompleteActiveList") @PostMapping("/queryCompleteActiveList")
public ResponseVo<String> queryCompleteActiveList() { public ResponseVo<String> queryCompleteActiveList(@RequestBody LarkActiveRequest request) {
return new ResponseVo(); List<String> list = larkActiveService.queryCompleteActiveUserName(request.getCompanyName());
return new ResponseVo(list);
} }
/** /**
* todo yxy *
*/ */
@PostMapping("/queryMyCompleteActiveList") @PostMapping("/queryMyCompleteActiveList")
public ResponseVo<String> queryMyCompleteActiveList() { public ResponseVo<LarkActive> queryMyCompleteActiveList(@RequestBody LarkActiveRequest request) {
return new ResponseVo(); List<LarkActive> larkActives = larkActiveService.queryCompleteActiveByUserName(request);
return new ResponseVo(larkActives);
} }
/** /**
* top 10 todo yxy * top 10
*/ */
@PostMapping("/queryInviteTopTen") @PostMapping("/queryInviteTopTen")
public ResponseVo<String> queryInviteTopTen() { public ResponseVo<LarkUserActiveInviteRelatoin> queryInviteTopTen(LarkUserActiveInviteRelatoin request) {
return new ResponseVo(); List<LarkUserActiveInviteRelatoin> larkUserActiveInviteRelatoins = larkUserActiveInviteRelatoinService.queryTopTen(request);
return new ResponseVo(larkUserActiveInviteRelatoins);
} }
/**
*
*/
@PostMapping("/queryCount")
public ResponseVo<LarkActiveCountVo> queryCount(@RequestBody LarkUserActiveRelatoin request) {
LarkActiveCountVo larkActiveCountVo = larkUserActiveRelatoinService.queryCount(request);
return new ResponseVo(larkActiveCountVo);
}
} }

@ -0,0 +1,30 @@
package com.ruoyi.flyingbook.domain.larkactive;
import com.ruoyi.flyingbook.domain.LarkActive;
import lombok.Data;
import java.util.List;
/**
* lark_active
*
* @author ruoyi
* @date 2023-08-16
*/
@Data
public class LarkActiveCountVo {
/**
*
*/
private Integer totalClickQty;
/**
*
*/
private Integer totalUserQty;
/**
*
*/
private List<LarkActiveVo> activeUserQtyList;
}

@ -3,6 +3,8 @@ package com.ruoyi.flyingbook.domain.larkactive;
import com.ruoyi.common.core.domain.RequestVo; import com.ruoyi.common.core.domain.RequestVo;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author yuxiangyong * @author yuxiangyong
* @create 2023-08-16 16:58 * @create 2023-08-16 16:58
@ -13,6 +15,7 @@ public class LarkActiveRequest extends RequestVo {
private String companyName; private String companyName;
private Long larkActiveId; private Long larkActiveId;
private List<Long> larkActiveIdList;
private String userName; private String userName;
/** /**

@ -0,0 +1,29 @@
package com.ruoyi.flyingbook.domain.larkactive;
import com.ruoyi.common.core.domain.RequestVo;
import lombok.Data;
/**
* @author yuxiangyong
* @create 2023-08-16 16:58
*/
@Data
public class LarkActiveUserRelationRequest extends RequestVo {
private String companyName;
private Long larkActiveId;
private String userName;
/**
* @see com.ruoyi.common.enums.FlagStatus
*/
private Long flag;
/**
*
* @see com.ruoyi.common.enums.LarkActiveStageEnum
*/
private String activeStage;
}

@ -17,4 +17,6 @@ public class LarkActiveVo extends LarkActive {
*/ */
private Boolean complete; private Boolean complete;
private Integer qty;
} }

@ -29,6 +29,7 @@ public interface LarkActiveMapper {
public List<LarkActive> selectLarkActiveList(LarkActive larkActive); public List<LarkActive> selectLarkActiveList(LarkActive larkActive);
public Integer count(LarkActive larkActive); public Integer count(LarkActive larkActive);
public List<LarkActive> queryPage(LarkActiveRequest request); public List<LarkActive> queryPage(LarkActiveRequest request);
public List<LarkActive> queryCompleteActive(LarkActiveRequest larkActive);
/** /**
* *
* *

@ -27,6 +27,8 @@ public interface LarkUserActiveInviteRelatoinMapper {
*/ */
public List<LarkUserActiveInviteRelatoin> selectLarkUserActiveInviteRelatoinList(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin); public List<LarkUserActiveInviteRelatoin> selectLarkUserActiveInviteRelatoinList(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin);
public List<LarkUserActiveInviteRelatoin> queryTopTen(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin);
/** /**
* *
* *

@ -1,6 +1,10 @@
package com.ruoyi.flyingbook.mapper; package com.ruoyi.flyingbook.mapper;
import com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin; import com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveCountVo;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveUserRelationRequest;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveVo;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -26,6 +30,12 @@ public interface LarkUserActiveRelatoinMapper {
* @return * @return
*/ */
public List<LarkUserActiveRelatoin> selectLarkUserActiveRelatoinList(LarkUserActiveRelatoin larkUserActiveRelatoin); public List<LarkUserActiveRelatoin> selectLarkUserActiveRelatoinList(LarkUserActiveRelatoin larkUserActiveRelatoin);
public List<LarkUserActiveRelatoin> queryPage(LarkActiveUserRelationRequest larkUserActiveRelatoin);
public int count(LarkUserActiveRelatoin larkUserActiveRelatoin);
public List<String> queryCompleteActiveUserName(@Param("count") Integer count,@Param("companyName") String companyName);
public int queryUserCount(LarkUserActiveRelatoin larkUserActiveRelatoin);
public List<LarkActiveVo> queryUserCountGroupByActive(LarkUserActiveRelatoin larkUserActiveRelatoin);
/** /**
* *

@ -33,6 +33,9 @@ public interface ILarkActiveService {
public List<LarkActive> selectLarkActiveList(LarkActive larkActive); public List<LarkActive> selectLarkActiveList(LarkActive larkActive);
ResponseVo<LarkActive> queryPage(LarkActiveRequest request); ResponseVo<LarkActive> queryPage(LarkActiveRequest request);
public List<String> queryCompleteActiveUserName(String companyName);
public List<LarkActive> queryCompleteActiveByUserName(LarkActiveRequest larkActive);
/** /**
* *
* *

@ -27,6 +27,8 @@ public interface ILarkUserActiveInviteRelatoinService {
*/ */
public List<LarkUserActiveInviteRelatoin> selectLarkUserActiveInviteRelatoinList(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin); public List<LarkUserActiveInviteRelatoin> selectLarkUserActiveInviteRelatoinList(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin);
public List<LarkUserActiveInviteRelatoin> queryTopTen(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin);
/** /**
* *
* *

@ -1,6 +1,9 @@
package com.ruoyi.flyingbook.service; package com.ruoyi.flyingbook.service;
import com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin; import com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin;
import com.ruoyi.flyingbook.domain.edi.ResponseVo;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveCountVo;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveUserRelationRequest;
import java.util.List; import java.util.List;
@ -19,6 +22,8 @@ public interface ILarkUserActiveRelatoinService {
*/ */
public LarkUserActiveRelatoin selectLarkUserActiveRelatoinById(Long id); public LarkUserActiveRelatoin selectLarkUserActiveRelatoinById(Long id);
public LarkActiveCountVo queryCount(LarkUserActiveRelatoin request);
/** /**
* *
* *
@ -26,6 +31,7 @@ public interface ILarkUserActiveRelatoinService {
* @return * @return
*/ */
public List<LarkUserActiveRelatoin> selectLarkUserActiveRelatoinList(LarkUserActiveRelatoin larkUserActiveRelatoin); public List<LarkUserActiveRelatoin> selectLarkUserActiveRelatoinList(LarkUserActiveRelatoin larkUserActiveRelatoin);
public ResponseVo<LarkUserActiveRelatoin> queryPage(LarkActiveUserRelationRequest request);
/** /**
* *

@ -1,6 +1,7 @@
package com.ruoyi.flyingbook.service.impl; package com.ruoyi.flyingbook.service.impl;
import com.ruoyi.common.enums.FlagStatus; import com.ruoyi.common.enums.FlagStatus;
import com.ruoyi.common.enums.LarkActiveStageEnum;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.flyingbook.domain.LarkActive; import com.ruoyi.flyingbook.domain.LarkActive;
import com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin; import com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin;
@ -16,6 +17,7 @@ import org.springframework.beans.BeanUtils;
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.List; import java.util.List;
/** /**
@ -91,6 +93,19 @@ public class LarkActiveServiceImpl implements ILarkActiveService {
return new ResponseVo(request.getCurrentPage(),request.getPageSize(),null,count); return new ResponseVo(request.getCurrentPage(),request.getPageSize(),null,count);
} }
@Override
public List<String> queryCompleteActiveUserName(String companyName) {
LarkActive larkActive = new LarkActive();
larkActive.setFlag(FlagStatus.OK.getCode());
Integer count = larkActiveMapper.count(larkActive);
return larkUserActiveRelatoinMapper.queryCompleteActiveUserName(count,companyName);
}
@Override
public List<LarkActive> queryCompleteActiveByUserName(LarkActiveRequest larkActive) {
return larkActiveMapper.queryCompleteActive(larkActive);
}
/** /**
* *
* *

@ -1,5 +1,6 @@
package com.ruoyi.flyingbook.service.impl; package com.ruoyi.flyingbook.service.impl;
import com.ruoyi.common.enums.FlagStatus;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.flyingbook.domain.LarkUserActiveInviteRelatoin; import com.ruoyi.flyingbook.domain.LarkUserActiveInviteRelatoin;
import com.ruoyi.flyingbook.mapper.LarkUserActiveInviteRelatoinMapper; import com.ruoyi.flyingbook.mapper.LarkUserActiveInviteRelatoinMapper;
@ -42,6 +43,12 @@ public class LarkUserActiveInviteRelatoinServiceImpl implements ILarkUserActiveI
return larkUserActiveInviteRelatoinMapper.selectLarkUserActiveInviteRelatoinList(larkUserActiveInviteRelatoin); return larkUserActiveInviteRelatoinMapper.selectLarkUserActiveInviteRelatoinList(larkUserActiveInviteRelatoin);
} }
@Override
public List<LarkUserActiveInviteRelatoin> queryTopTen(LarkUserActiveInviteRelatoin larkUserActiveInviteRelatoin) {
larkUserActiveInviteRelatoin.setFlag(FlagStatus.OK.getCode());
return larkUserActiveInviteRelatoinMapper.queryTopTen(larkUserActiveInviteRelatoin);
}
/** /**
* *
* *

@ -1,13 +1,28 @@
package com.ruoyi.flyingbook.service.impl; package com.ruoyi.flyingbook.service.impl;
import com.ruoyi.common.enums.FlagStatus;
import com.ruoyi.common.enums.LarkActiveStageEnum;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.flyingbook.domain.LarkActive;
import com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin; import com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin;
import com.ruoyi.flyingbook.domain.edi.ResponseVo;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveCountVo;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveRequest;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveUserRelationRequest;
import com.ruoyi.flyingbook.domain.larkactive.LarkActiveVo;
import com.ruoyi.flyingbook.mapper.LarkActiveMapper;
import com.ruoyi.flyingbook.mapper.LarkUserActiveRelatoinMapper; import com.ruoyi.flyingbook.mapper.LarkUserActiveRelatoinMapper;
import com.ruoyi.flyingbook.service.ILarkUserActiveRelatoinService; import com.ruoyi.flyingbook.service.ILarkUserActiveRelatoinService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
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.List; import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/** /**
* Service * Service
@ -19,6 +34,8 @@ import java.util.List;
public class LarkUserActiveRelatoinServiceImpl implements ILarkUserActiveRelatoinService { public class LarkUserActiveRelatoinServiceImpl implements ILarkUserActiveRelatoinService {
@Autowired @Autowired
private LarkUserActiveRelatoinMapper larkUserActiveRelatoinMapper; private LarkUserActiveRelatoinMapper larkUserActiveRelatoinMapper;
@Autowired
private LarkActiveMapper larkActiveMapper;
/** /**
* *
@ -31,6 +48,35 @@ public class LarkUserActiveRelatoinServiceImpl implements ILarkUserActiveRelatoi
return larkUserActiveRelatoinMapper.selectLarkUserActiveRelatoinById(id); return larkUserActiveRelatoinMapper.selectLarkUserActiveRelatoinById(id);
} }
@Override
public LarkActiveCountVo queryCount(LarkUserActiveRelatoin request) {
LarkActiveCountVo larkActiveCountVo = new LarkActiveCountVo();
LarkUserActiveRelatoin larkUserActiveRelatoin = new LarkUserActiveRelatoin();
larkUserActiveRelatoin.setActiveStage(LarkActiveStageEnum.ADJUST.getCode());
larkUserActiveRelatoin.setFlag(FlagStatus.OK.getCode());
larkUserActiveRelatoin.setUserName(request.getUserName());
int userCount = larkUserActiveRelatoinMapper.queryUserCount(larkUserActiveRelatoin);
larkActiveCountVo.setTotalUserQty(userCount);
List<LarkActiveVo> larkActiveCountVos = larkUserActiveRelatoinMapper.queryUserCountGroupByActive(larkUserActiveRelatoin);
if (CollectionUtils.isNotEmpty(larkActiveCountVos)){
List<Long> activeIdList = larkActiveCountVos.stream().map(LarkActiveVo::getId).distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(activeIdList)){
LarkActiveRequest query = new LarkActiveRequest();
query.setFlag(FlagStatus.OK.getCode());
query.setLarkActiveIdList(activeIdList);
Map<Long, LarkActive> activeMap = larkActiveMapper.queryCompleteActive(query).stream().collect(Collectors.toMap(LarkActive::getId, Function.identity(), (k1, k2) -> k1));
for (LarkActiveVo activeCountVo : larkActiveCountVos) {
LarkActive larkActive = activeMap.get(activeCountVo.getId());
if (larkActive != null){
BeanUtils.copyProperties(larkActive,activeCountVo);
}
}
}
}
larkActiveCountVo.setActiveUserQtyList(larkActiveCountVos);
return larkActiveCountVo;
}
/** /**
* *
* *
@ -42,6 +88,22 @@ public class LarkUserActiveRelatoinServiceImpl implements ILarkUserActiveRelatoi
return larkUserActiveRelatoinMapper.selectLarkUserActiveRelatoinList(larkUserActiveRelatoin); return larkUserActiveRelatoinMapper.selectLarkUserActiveRelatoinList(larkUserActiveRelatoin);
} }
@Override
public ResponseVo<LarkUserActiveRelatoin> queryPage(LarkActiveUserRelationRequest request) {
if (request == null || StringUtils.isBlank(request.getCompanyName())){
return new ResponseVo(request.getCurrentPage(),request.getPageSize());
}
request.setFlag(FlagStatus.OK.getCode());
LarkUserActiveRelatoin larkActive = new LarkUserActiveRelatoin();
BeanUtils.copyProperties(request,larkActive);
Integer count = larkUserActiveRelatoinMapper.count(larkActive);
if (count > 0){
List<LarkUserActiveRelatoin> larkUserActiveRelatoins = larkUserActiveRelatoinMapper.queryPage(request);
return new ResponseVo(request.getCurrentPage(),request.getPageSize(),larkUserActiveRelatoins,count);
}
return new ResponseVo(request.getCurrentPage(),request.getPageSize(),null,count);
}
/** /**
* *
* *

@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="count" parameterType="com.ruoyi.flyingbook.domain.LarkActive" resultMap="LarkActiveResult"> <select id="count" parameterType="com.ruoyi.flyingbook.domain.LarkActive" resultType="java.lang.Integer">
select count(id) from lark_active select count(id) from lark_active
<where> <where>
<if test="companyId != null "> and company_id = #{companyId}</if> <if test="companyId != null "> and company_id = #{companyId}</if>
@ -72,6 +72,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
limit #{offset},{pageSize} limit #{offset},{pageSize}
</select> </select>
<select id="queryCompleteActive" parameterType="com.ruoyi.flyingbook.domain.larkactive.LarkActiveRequest" resultMap="LarkActiveResult">
<include refid="selectLarkActiveVo"/>
<where>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="activeName != null and activeName != ''"> and active_name like concat('%', #{activeName}, '%')</if>
<if test="activeDesc != null and activeDesc != ''"> and active_desc = #{activeDesc}</if>
<if test="activeContent != null and activeContent != ''"> and active_content = #{activeContent}</if>
<if test="activeImageUrl != null and activeImageUrl != ''"> and active_image_url = #{activeImageUrl}</if>
<if test="activeType != null and activeType != ''"> and active_type = #{activeType}</if>
<if test="activeScore != null and activeScore != ''"> and active_score = #{activeScore}</if>
<if test="flag != null "> and flag = #{flag}</if>
<if test="larkActiveIdList != null ">
and id in <foreach collection="larkActiveIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="selectLarkActiveById" parameterType="Long" resultMap="LarkActiveResult"> <select id="selectLarkActiveById" parameterType="Long" resultMap="LarkActiveResult">
<include refid="selectLarkActiveVo"/> <include refid="selectLarkActiveVo"/>
where id = #{id} where id = #{id}

@ -35,6 +35,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="queryTopTen" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveInviteRelatoin" resultMap="LarkUserActiveInviteRelatoinResult">
SELECT
id,
company_id,
company_name,
user_name,
invite_user_name,
invite_stage,
COUNT(id) as total
FROM
lark_user_active_invite_relatoin
WHERE
company_name = #{companyName} and invite_stage = #{inviteStage} and flag = #{flag}
GROUP BY
user_name
ORDER BY total DESC
LIMIT 10
</select>
<select id="selectLarkUserActiveInviteRelatoinById" parameterType="Long" resultMap="LarkUserActiveInviteRelatoinResult"> <select id="selectLarkUserActiveInviteRelatoinById" parameterType="Long" resultMap="LarkUserActiveInviteRelatoinResult">
<include refid="selectLarkUserActiveInviteRelatoinVo"/> <include refid="selectLarkUserActiveInviteRelatoinVo"/>
where id = #{id} where id = #{id}

@ -20,14 +20,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectLarkUserActiveRelatoinVo"> <sql id="selectLarkUserActiveRelatoinVo">
select id, company_id, company_name, user_name, active_id, active_stage, create_by, create_time, update_by, update_time, flag, remark from lark_user_active_relatoin select id,
company_id,
company_name,
user_name,
active_id,
active_stage,
create_by,
create_time,
update_by,
update_time,
flag,
remark
from lark_user_active_relatoin
</sql> </sql>
<select id="selectLarkUserActiveRelatoinList" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin" resultMap="LarkUserActiveRelatoinResult"> <select id="selectLarkUserActiveRelatoinList" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
resultMap="LarkUserActiveRelatoinResult">
<include refid="selectLarkUserActiveRelatoinVo"/> <include refid="selectLarkUserActiveRelatoinVo"/>
<where> <where>
<if test="companyId != null ">and company_id = #{companyId}</if> <if test="companyId != null ">and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if> <if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
'%')
</if>
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if> <if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
<if test="activeId != null ">and active_id = #{activeId}</if> <if test="activeId != null ">and active_id = #{activeId}</if>
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if> <if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
@ -35,12 +50,84 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="queryPage" parameterType="com.ruoyi.flyingbook.domain.larkactive.LarkActiveUserRelationRequest"
resultMap="LarkUserActiveRelatoinResult">
<include refid="selectLarkUserActiveRelatoinVo"/>
<where>
<if test="companyId != null ">and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
'%')
</if>
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
<if test="activeId != null ">and active_id = #{activeId}</if>
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
<if test="flag != null ">and flag = #{flag}</if>
</where>
limit #{offset},{pageSize}
</select>
<select id="count" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
resultType="java.lang.Integer">
select count(id) from lark_user_active_relatoin
<where>
<if test="companyId != null ">and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
'%')
</if>
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
<if test="activeId != null ">and active_id = #{activeId}</if>
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
<if test="flag != null ">and flag = #{flag}</if>
</where>
</select>
<select id="queryUserCount" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
resultType="java.lang.Integer">
select count(id) from lark_user_active_relatoin
<where>
<if test="companyId != null ">and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
'%')
</if>
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
<if test="activeId != null ">and active_id = #{activeId}</if>
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
<if test="flag != null ">and flag = #{flag}</if>
</where>
group by user_name
</select>
<select id="queryUserCountGroupByActive" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
resultMap="com.ruoyi.flyingbook.domain.larkactive.LarkActiveCountVo">
select active_id as id ,count(id) as qty from lark_user_active_relatoin
<where>
<if test="companyId != null ">and company_id = #{companyId}</if>
<if test="companyName != null and companyName != ''">and company_name like concat('%', #{companyName},
'%')
</if>
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
<if test="activeId != null ">and active_id = #{activeId}</if>
<if test="activeStage != null and activeStage != ''">and active_stage = #{activeStage}</if>
<if test="flag != null ">and flag = #{flag}</if>
</where>
group by active_id
</select>
<select id="queryCompleteActiveUserName" resultType="java.lang.String">
select user_name, COUNT(id) as total
from lark_user_active_relatoin
where company_name = #{companyName}
GROUP BY user_name
HAVING total > #{count}
</select>
<select id="selectLarkUserActiveRelatoinById" parameterType="Long" resultMap="LarkUserActiveRelatoinResult"> <select id="selectLarkUserActiveRelatoinById" parameterType="Long" resultMap="LarkUserActiveRelatoinResult">
<include refid="selectLarkUserActiveRelatoinVo"/> <include refid="selectLarkUserActiveRelatoinVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertLarkUserActiveRelatoin" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin" useGeneratedKeys="true" keyProperty="id"> <insert id="insertLarkUserActiveRelatoin" parameterType="com.ruoyi.flyingbook.domain.LarkUserActiveRelatoin"
useGeneratedKeys="true" keyProperty="id">
insert into lark_user_active_relatoin insert into lark_user_active_relatoin
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyId != null">company_id,</if> <if test="companyId != null">company_id,</if>
@ -89,7 +176,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteLarkUserActiveRelatoinById" parameterType="Long"> <delete id="deleteLarkUserActiveRelatoinById" parameterType="Long">
delete from lark_user_active_relatoin where id = #{id} delete
from lark_user_active_relatoin
where id = #{id}
</delete> </delete>
<delete id="deleteLarkUserActiveRelatoinByIds" parameterType="String"> <delete id="deleteLarkUserActiveRelatoinByIds" parameterType="String">

Loading…
Cancel
Save