大屏接口

dev_0531
yechenhao 6 years ago
parent b4bc30c1e5
commit d53abf7c4c

@ -14,6 +14,8 @@ public interface PrivilageCpUserDOMapper extends BaseMapper<PrivilageCpUserDO> {
CpUserCustomerRelationDO selectCpUserCustomerRelation(@Param("customerUserId")String custeromUserId, @Param("cpUserId")String cpUserId, @Param("cpId")Long cpId); CpUserCustomerRelationDO selectCpUserCustomerRelation(@Param("customerUserId")String custeromUserId, @Param("cpUserId")String cpUserId, @Param("cpId")Long cpId);
List<String> selectCpUserCustomerRelationByCpId(@Param("cpId")Long cpId);
Long selectAllCount(); Long selectAllCount();
Long selectDistinctAllCount(); Long selectDistinctAllCount();

@ -58,9 +58,9 @@ public class CountDTOMessageGroupConsumer implements WorkHandler<CountDTOMessage
privilageCpUserDOMapper.insert(privilageCpUserDO); privilageCpUserDOMapper.insert(privilageCpUserDO);
} }
//批量添加账号 //批量添加账号
List<String> addedCustomerUserIds = privilageCpUserDOMapper.selectCpUserCustomerRelationByCpId(privilageCpUserDO.getId());
for (String customerStr : customerStrs) { for (String customerStr : customerStrs) {
CpUserCustomerRelationDO cpUserCustomerRelationDO = privilageCpUserDOMapper.selectCpUserCustomerRelation(customerStr, cpUserId, privilageCpUserDO.getId()); if (CollectionUtils.isEmpty(addedCustomerUserIds) || !addedCustomerUserIds.contains(customerStr)){
if (cpUserCustomerRelationDO == null){
privilageCpUserDOMapper.insertCpUserCustomerRelation(customerStr,cpUserId,privilageCpUserDO.getId()); privilageCpUserDOMapper.insertCpUserCustomerRelation(customerStr,cpUserId,privilageCpUserDO.getId());
} }
} }

@ -14,6 +14,11 @@
</if> </if>
limit 1 limit 1
</select> </select>
<select id="selectCpUserCustomerRelationByCpId" resultType="java.lang.String">
select customer_user_id as customerUserId
from op_cp_user_customer_relation
where cp_id = #{cpId}
</select>
<select id="selectAllCount" resultType="java.lang.Long"> <select id="selectAllCount" resultType="java.lang.Long">
select count(id) from op_cp_user_customer_relation select count(id) from op_cp_user_customer_relation

Loading…
Cancel
Save