yxh
8 天以前 b1f41c066b0b7c38faffddbfe73b9be8d0bd508e
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
<?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.project.mapper.CasePanoramaMapper">
 
    <sql id="casePanoramaColumns">
        id,
        DonorName AS donorName,
        ReportTime AS reportTime,
        deptname AS deptName,
        ReporterName AS reporterName,
        Dontiontermination AS terminationFlag,
        workflow AS workflow,
        COALESCE(dd.dict_label, CAST(workflow AS CHAR)) AS workflowName,
        DonateTime AS donateTime,
        DonationHospital AS donationHospital,
        OrganName AS organName,
        OrganProcurement AS organProcurement,
        OrganTransplantation AS organTransplantation,
        COALESCE(DonorFamilysCost, 0) + COALESCE(medCost, 0) + COALESCE(ExpertCost, 0) + COALESCE(ItemCode3_4, 0) AS totalCost,
        DonorFamilysCost AS donorFamilyCost,
        medCost AS medCost,
        ExpertCost AS expertCost,
        ItemCode3_4 AS itemCode34,
        ItemCode42 AS itemCode42,
        ItemCode46 AS itemCode46,
        ItemCode50 AS itemCode50,
        ItemCode44 AS itemCode44,
        ItemCode47 AS itemCode47,
        ItemCode48 AS itemCode48,
        ItemCode21 AS itemCode21,
        ItemCode12 AS itemCode12,
        ItemCode17 AS itemCode17,
        ItemCode23 AS itemCode23,
        ItemCode25 AS itemCode25
    </sql>
 
    <select id="selectCasePanoramaList" resultType="com.ruoyi.project.domain.CasePanorama">
        SELECT
        <include refid="casePanoramaColumns"/>
        FROM v_donationfeestat v
        LEFT JOIN (
            SELECT dict_value, MAX(dict_label) AS dict_label
            FROM sys_dict_data
            WHERE dict_type = 'sys_donornode'
            GROUP BY dict_value
        ) dd ON dd.dict_value COLLATE utf8mb4_general_ci = CAST(v.workflow AS CHAR) COLLATE utf8mb4_general_ci
        <where>
            <if test="req.donorName != null and req.donorName != ''">
                AND DonorName LIKE CONCAT('%', #{req.donorName}, '%')
            </if>
            <if test="req.donateTimeBegin != null and req.donateTimeBegin != ''">
                AND DonateTime &gt;= #{req.donateTimeBegin}
            </if>
            <if test="req.donateTimeEnd != null and req.donateTimeEnd != ''">
                AND DonateTime &lt;= #{req.donateTimeEnd}
            </if>
            <if test="req.deptName != null and req.deptName != ''">
                AND deptname = #{req.deptName}
            </if>
            <if test="req.reporterName != null and req.reporterName != ''">
                AND ReporterName LIKE CONCAT('%', #{req.reporterName}, '%')
            </if>
        </where>
        ORDER BY ReportTime DESC, id DESC
    </select>
 
    <select id="selectDeptNames" resultType="java.lang.String">
        SELECT DISTINCT deptname
        FROM v_donationfeestat
        WHERE deptname IS NOT NULL AND deptname != ''
        ORDER BY deptname
    </select>
 
</mapper>