zjh
2025-01-15 5489d624e6642b459ecf8d143c548ac8a980a8c8
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
package com.ltkj.hosp.mapper;
 
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.hosp.domain.TjStandard;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
 
/**
 * standardMapper接口
 *
 * @author ltkj
 * @date 2022-11-24
 */
@Mapper
public interface TjStandardMapper extends BaseMapper<TjStandard> {
    /**
     * 查询standard
     *
     * @param id standard主键
     * @return standard
     */
    public TjStandard selectTjStandardById(String id);
 
    /**
     * 查询standard列表
     *
     * @param tjStandard standard
     * @return standard集合
     */
    public List<TjStandard> selectTjStandardList(TjStandard tjStandard);
 
    /**
     * 新增standard
     *
     * @param tjStandard standard
     * @return 结果
     */
    public int insertTjStandard(TjStandard tjStandard);
 
    /**
     * 修改standard
     *
     * @param tjStandard standard
     * @return 结果
     */
    public int updateTjStandard(TjStandard tjStandard);
 
    /**
     * 删除standard
     *
     * @param id standard主键
     * @return 结果
     */
    public int deleteTjStandardById(String id);
 
    /**
     * 批量删除standard
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTjStandardByIds(String[] ids);
 
    @Select("SELECT * FROM tj_standard  WHERE  pro_id=#{proId} AND deleted='0'")
    public List<TjStandard> getTjStandardListByProId(String proId);
 
 
    @Select("select * from tj_standard \n" +
            "where IF(NULL is NULL, 0 = 0, tj_sex =#{tjSex})\n" +
            "AND IF(NULL is NULL, 0 = 0, tj_type=#{tjType})\n" +
            "AND stan_id in \n" +
            "(SELECT stan_id FROM tj_standard  WHERE  pro_id=#{proId} AND deleted='0')")
    public TjStandard getListBySexAndType(@Param("tjSex") Long tjSex,@Param("tjType") int tjType,@Param("proId") String proId);
 
 
    @Select("SELECT * FROM tj_standard a  WHERE a.deleted='0' AND  a.pro_id=#{proId}  AND   a.tj_sex=#{tjSex} AND  a.tj_type=#{tjType}")
    public TjStandard getTjStandardBySexAndType(@Param("tjSex")Long tjSex,@Param("tjType")int tjType,@Param("proId") String proId);
}