<?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 >= #{req.donateTimeBegin}
|
</if>
|
<if test="req.donateTimeEnd != null and req.donateTimeEnd != ''">
|
AND DonateTime <= #{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>
|