You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.6 KiB
43 lines
1.6 KiB
<?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.ccsens.carbasics.persist.dao.PatientDao">
|
|
|
|
<select id="queryRecordByAidId" resultType="com.ccsens.carbasics.bean.vo.PatientVo$AidRecord">
|
|
SELECT
|
|
a.id,
|
|
r.question_code as questionCode,
|
|
r.answer
|
|
FROM
|
|
t_qcp_first_aid a LEFT JOIN
|
|
t_qcp_first_aid_record r on a.id = r.first_aid_id and r.rec_status = 0
|
|
WHERE
|
|
a.project_id = #{projectId}
|
|
<if test="codeList != null and codeList.size() > 0">
|
|
AND r.question_code in
|
|
<foreach collection="codeList" item="code" separator="," open="(" close=")">
|
|
#{code}
|
|
</foreach>
|
|
</if>
|
|
and a.rec_status = 0
|
|
</select>
|
|
<select id="querySubordinate" resultType="com.ccsens.carbasics.bean.vo.PatientVo$QuerySubordinate">
|
|
SELECT
|
|
count(*) AS totalNum,
|
|
count( r.question_code ) AS completeNum
|
|
FROM
|
|
( SELECT id, question_code FROM t_qcp_code_parent WHERE parent_code = #{code} AND rec_status = 0 ) p
|
|
LEFT JOIN (
|
|
SELECT DISTINCT
|
|
r.question_code
|
|
FROM
|
|
t_qcp_first_aid_record r,
|
|
t_qcp_first_aid a
|
|
WHERE
|
|
r.first_aid_id = a.id
|
|
AND a.project_id = #{projectId}
|
|
AND a.rec_status = 0
|
|
AND r.rec_status = 0
|
|
) r ON p.question_code = r.question_code
|
|
</select>
|
|
|
|
</mapper>
|