puzhibing
6 天以前 fccb84b175884930aacfa3531c5bdb4333f8c851
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.TPedigreeChartMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TPedigreeChart">
        <result column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
        <result column="generation_type" property="generationType" />
        <result column="strain_name" property="strainName" />
        <result column="strain_code" property="strainCode" />
        <result column="strain_source_start" property="strainSourceStart" />
        <result column="strain_source_end" property="strainSourceEnd" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, create_time, update_time, create_by, update_by, disabled, generation_type, strain_name, strain_code, strain_source_start, strain_source_end
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TPedigreeChartVO">
        SELECT
        *
        FROM t_pedigree_chart
        <where>
            <if test="query.strainName != null and query.strainName != ''">
                AND strain_name LIKE CONCAT('%', #{query.strainName}, '%')
            </if>
            <if test="query.strainCode != null and query.strainCode != ''">
                AND strain_code LIKE CONCAT('%', #{query.strainCode}, '%')
            </if>
            <if test="query.generationType != null">
                and generation_type = #{query.generationType}
            </if>
            <if test="query.roleType == 1">
                and status = 2
            </if>
            <if test="query.roleType == 2">
                and (status = 1 or status = 2)
            </if>
            <if test="query.roleType == 3">
                and (status = 2 or status = 1)
            </if>
        <if test="query.projectIds != null and query.projectIds.size() > 0">
            and project_id in
            <foreach item="item" collection="query.projectIds" separator="," open="(" close=")" index="">
                #{item}
            </foreach>
        </if>
            AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY create_time DESC
    </select>
    <select id="listConfirm" resultType="com.ruoyi.system.vo.TPedigreeChartConfirmVO">
        select t1.* from t_pedigree_chart_detail t1
        where t1.pedigree_chart_id = #{query.id}
          AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        and t1.preserve_signature is null
 
    </select>
    <select id="pageListDetail" resultType="com.ruoyi.system.vo.TPedigreeChartDetailVO">
        select  * from t_pedigree_chart_detail
        where pedigree_chart_id = #{query.id}
          and status = 1
          and type = 1
          and audit_status = 1
          and  disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        order by create_time desc
    </select>
    <select id="pageListCountDetail" resultType="com.ruoyi.system.vo.TPedigreeChartDetailVO">
        select  * from t_pedigree_chart_detail
        where pedigree_chart_id = #{query.id}
          and status = 1
          and type = 2
          and audit_status = 1
          and  disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        order by create_time desc
    </select>
 
 
</mapper>