songhuangfeng123
2022-08-12 6d0b2b2d93eab87b246c05a2a217ab16357e5f01
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
35
36
37
package com.gkhy.safePlatform.targetDuty.repository;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gkhy.safePlatform.targetDuty.entity.RewardPunishmentDetail;
import com.gkhy.safePlatform.targetDuty.model.dto.resp.RewardPunishmentDetailDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
 
import java.util.List;
 
/**
 * 奖惩记录(RewardPunishmentDetail)表数据库访问层
 *
 * @author xurui
 * @since 2022-07-21 10:15:45
 */
@Repository
public interface RewardPunishmentDetailRepository extends BaseMapper<RewardPunishmentDetail> {
 
    @Select("<script> select a.id,a.person_id,a.person_name,a.create_time ,a.memo,b.standard_type ,b.content ,b.q_name ,b.reason " +
            "from reward_punishment_detail a left join reward_punishment_standard b on a.reward_punishment_standard_id=b.id  where 1=1  " +
            "<if test =\"personId !='' and personId !=null\">and find_in_set( #{personId}, a.person_id )</if> </script> ")
    IPage<RewardPunishmentDetailDto> queryAll(IPage<RewardPunishmentDetailDto> page, @Param("personId") String personId);
 
    @Select("<script> select a.id,a.person_id,a.person_name,a.create_time ,a.memo,b.standard_type ,b.content ,b.q_name ,b.reason " +
            "from reward_punishment_detail a left join reward_punishment_standard b on a.reward_punishment_standard_id=b.id  where 1=1  " +
            "<if test =\"personId !='' and personId !=null\">and find_in_set( #{personId}, a.person_id )</if> </script> ")
    List<RewardPunishmentDetail> queryAll(@Param("personId") String personId);
 
 
//    @Select("<script> select a.id,a.person_id,a.person_name,a.create_time ,a.memo,b.standard_type ,b.content ,b.q_name ,b.reason " +
//            "from reward_punishment_detail a left join reward_punishment_standard b on a.reward_punishment_standard_id=b.id  where 1=1  " +
//            "<if test =\"personId !='' and personId !=null\">and a.person_id =#{personId}</if> </script> ")
//    List<RewardPunishmentDetail> queryAll( @Param("personId")String personId);
}