zjh
2023-10-12 8cde7ee1143bae70eb68d2b75f572d5b4dbadf98
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package com.ltkj.hosp.mapper;
 
import java.util.List;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.hosp.domain.TjPackage;
import com.ltkj.hosp.domain.TjProject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
 
/**
 * 体检套餐Mapper接口
 *
 * @author ltkj
 * @date 2022-11-17
 */
@Mapper
public interface TjPackageMapper extends BaseMapper<TjPackage> {
 
//    /**
//     * 查询套餐内项目和所有项目
//     * */
//    @Select("SELECT (case when b.pac_id is null then 0 else 1 end) ischeck,a.pro_id,a.pro_name FROM tj_project a left join tj_package_project b on b.pro_id = a.pro_id and b.pac_id=#{pacid}")
//    public List<TjProject> showList(Long picid);
 
 
    /**
     * 查询体检套餐
     *
     * @param pacId 体检套餐主键
     * @return 体检套餐
     */
    public TjPackage selectTjPackageByPacId(String pacId);
 
    /**
     * 查询体检套餐列表
     *
     * @param tjPackage 体检套餐
     * @return 体检套餐集合
     */
    public List<TjPackage> selectTjPackageList(TjPackage tjPackage);
 
    /**
     * 新增体检套餐
     *
     * @param tjPackage 体检套餐
     * @return 结果
     */
    public int insertTjPackage(TjPackage tjPackage);
 
    /**
     * 修改体检套餐
     *
     * @param tjPackage 体检套餐
     * @return 结果
     */
    public int updateTjPackage(TjPackage tjPackage);
 
    /**
     * 删除体检套餐
     *
     * @param pacId 体检套餐主键
     * @return 结果
     */
    public int deleteTjPackageByPacId(Long pacId);
 
    /**
     * 批量删除体检套餐
     *
     * @param pacIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTjPackageByPacIds(Long[] pacIds);
 
    @Select("SELECT * FROM tj_package WHERE pac_id=#{pacId} AND deleted='0' ")
    public TjPackage getTjPackageByPacId(String pacId);
 
 
    @Select("SELECT * FROM  tj_package WHERE  !locate(\"女\",pac_name) and !locate(\"孕\",pac_name) and !locate(\"妇\",pac_name) and !locate(\"产\",pac_name) and pac_status=0 AND deleted =0 ORDER BY sort DESC")
    List<TjPackage> getTjPackageListByMan();
 
    @Select("SELECT * FROM  tj_package WHERE  !locate(\"男\",pac_name) and pac_status=0 AND deleted =0 ORDER BY sort DESC")
    List<TjPackage> getTjPackageListByWoMan();
 
 
    @Select("SELECT GROUP_CONCAT(b.pro_name ) AS names FROM tj_package_project a LEFT JOIN tj_project b ON a.pro_id=b.pro_id WHERE a.pac_id=#{pacId}")
    String getTjPacProNames(String pacId);
}