52 lines
1.8 KiB
Java
52 lines
1.8 KiB
Java
package com.whdc.mapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.whdc.model.entity.AutoCallPerson;
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @author lyf
|
|
* @since 2025-07-08
|
|
*/
|
|
public interface AutoCallPersonMapper extends BaseMapper<AutoCallPerson> {
|
|
default List<AutoCallPerson> listUnUploaded() {
|
|
return selectList(
|
|
new QueryWrapper<AutoCallPerson>()
|
|
.in("status", AutoCallPerson.STATUS_DEFAULT, AutoCallPerson.STATUS_UPLOADED, AutoCallPerson.STATUS_CALLED)
|
|
.lt("uploaded_times", 2)
|
|
.orderByAsc("id")
|
|
);
|
|
}
|
|
|
|
default boolean isAnySuccess(Integer taskId) {
|
|
return selectCount(
|
|
new QueryWrapper<AutoCallPerson>()
|
|
.eq("task_id", taskId)
|
|
.eq("status", AutoCallPerson.STATUS_PUT)
|
|
.eq("__tag", "已知晓")
|
|
) > 0;
|
|
}
|
|
|
|
default boolean isAllFail(Integer taskId) {
|
|
long personCnt = selectCount(
|
|
new QueryWrapper<AutoCallPerson>()
|
|
.eq("task_id", taskId)
|
|
);
|
|
long failCnt = selectCount(
|
|
new QueryWrapper<AutoCallPerson>()
|
|
.eq("task_id", taskId)
|
|
.eq("uploaded_times", 2)
|
|
.in("status", AutoCallPerson.STATUS_CALLED, AutoCallPerson.STATUS_CANCELLED,AutoCallPerson.STATUS_PUT)
|
|
//__tag == null or __tag != "已知晓"
|
|
.and(wrapper -> wrapper.isNull("__tag").or().ne("__tag", "已知晓"))
|
|
);
|
|
return personCnt == failCnt;
|
|
}
|
|
|
|
List<AutoCallPerson> selectListByTaskId(@Param("taskId") Integer taskId);
|
|
|
|
}
|