songhuangfeng123
2022-08-19 2595c1008bfe2d0d5e01f3b6b035faa7ccb8a2b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.gkhy.safePlatform.targetDuty.repository;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.safePlatform.targetDuty.entity.TargetMng;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
 
import java.util.Map;
 
/**
 * 目标指标(TargetMng)表数据库访问层
 *
 * @author xurui
 * @since 2022-07-20 11:49:22
 */
@Repository
public interface TargetMngRepository extends BaseMapper<TargetMng> {
    @Select("<script>select COUNT(1) from target_mng where 1=1 " +
            "<if test =\"divideStatus !='' and divideStatus !=null\">and divide_status = #{divideStatus}</if> " +
            "<if test =\"targetType !='' and targetType !=null\">and target_type = #{targetType}</if>" +
            "<if test =\"qName !='' and qName !=null\">and q_name = #{qName}</if>" +
            "<if test =\"indexNum !='' and indexNum !=null\">and index_num = #{indexNum}</if>" +
            "</script> ")
    Integer selectTotal(Map<String, Object> beanToMap);
 
    @Select("<script>select COUNT(target_id) from target_divide_detail a INNER JOIN target_mng b on a.target_id = b.id \n" +
            "WHERE a.id not in (select target_divide_detail_id from target_examine where examine_result = 1)\n" +
            "<if test =\"divideStatus !='' and divideStatus !=null\">and b.divide_status = #{divideStatus}</if> " +
            "<if test =\"targetType !='' and targetType !=null\">and b.target_type = #{targetType}</if>" +
            "<if test =\"qName !='' and qName !=null\">and b.q_name = #{qName}</if>" +
            "<if test =\"indexNum !='' and indexNum !=null\">and b.index_num = #{indexNum}</if>" +
            "GROUP BY a.target_id</script> ")
    Integer selectNoComplete(Map<String, Object> beanToMap);
}