陈昶聿
4 小时以前 5e09cd9bc9f370058460ca56222a0c82096a8c7d
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -213,7 +213,6 @@
               create_time,
               isupload,
               upload_time,
               orgid,
               pid,
               guid,
               text_param,
@@ -236,8 +235,6 @@
               leaveicd10code,
               orgid,
               visit_type,
               management_doctor,
               management_doctor_code,
               continue_flag,
               continue_time_now,
               continue_content,
@@ -257,9 +254,8 @@
        <include refid="selectServiceSubtaskVo"/>
        where 1=1
        and del_flag = 0
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if>
        <if test="campusid != null and campusid != ''">and campusid = #{campusid}</if>
        <if test="taskid != null ">and taskid = #{taskid}</if>
        <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if>
        <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow,jdbcType=TIMESTAMP}</if>
@@ -281,16 +277,11 @@
        <include refid="selectServiceSubtaskVo"/>
        where 1=1
        and del_flag = 0
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="subId != null">
            AND id = #{subId}
        </if>
        <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if>
        <if test="campusid != null and campusid != ''">and campusid = #{campusid}</if>
        <if test="subId != null">and id = #{subId}</if>
        <if test="taskid != null ">and taskid = #{taskid}</if>
        <if test="visitTime != null">
            AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{visitTime},'%y%m%d')
        </if>
        <if test="visitTime != null">and date_format(visit_time,'%y%m%d') &lt;= date_format(#{visitTime},'%y%m%d')</if>
        <if test="sendstate != null ">and sendstate = #{sendstate}</if>
        <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if>
        <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow,jdbcType=TIMESTAMP}</if>
@@ -582,15 +573,10 @@
        <include refid="selectServiceSubtaskVo"/>
        where del_flag = 0
        and sendstate != 5
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="visitTime != null">
            AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{visitTime},'%y%m%d')
        </if>
        <if test="subId != null">
            AND id = #{subId}
        </if>
        <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if>
        <if test="campusid != null and campusid != ''">and campusid = #{campusid}</if>
        <if test="visitTime != null">and date_format(visit_time,'%y%m%d') &lt;= date_format(#{visitTime},'%y%m%d') </if>
        <if test="subId != null">and id = #{subId} </if>
        <if test="sendstate != null ">and sendstate = #{sendstate}</if>
        <if test="continueFlag != null ">and continue_flag = #{continueFlag}</if>
        <if test="continueTimeNow != null ">and continue_time_now = #{continueTimeNow,jdbcType=TIMESTAMP}</if>
@@ -600,9 +586,8 @@
        <include refid="selectServiceSubtaskVo"/>
        where del_flag = 0
        and sendstate = 5
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if>
        <if test="campusid != null and campusid != ''">and campusid = #{campusid}</if>
        <if test="visitTime != null">
            AND date_format(visit_time,'%y%m%d') &lt;= date_format(DATE_ADD(#{visitTime}, INTERVAL 1 DAY),'%y%m%d')
        </if>
@@ -620,9 +605,8 @@
            resultMap="ServiceSubtaskResult">
        <include refid="selectServiceSubtaskVo"/>
        where del_flag = 0
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if>
        <if test="campusid != null and campusid != ''">and campusid = #{campusid}</if>
        <if test="createStartTime != null  and createEndTime != null">and create_time BETWEEN #{createStartTime} AND
            #{createEndTime}
        </if>
@@ -717,9 +701,8 @@
            DATE_FORMAT(b.create_time, '%Y-%m-%d') LIKE CONCAT(#{createTimeNew}, '%')
        </if>
        <if test="sendstate != null ">and b.sendstate = #{sendstate}</if>
        <if test="orgid != null and orgid != ''">
            and b.orgid = #{orgid}
        </if>
        <if test="orgid != null and orgid != ''">and b.orgid = #{orgid}</if>
        <if test="campusid != null and campusid != ''">and b.campusid = #{campusid}</if>
    </select>
    <select id="selectTimelyRate" parameterType="com.smartor.domain.ServiceSubtask" resultType="double">
@@ -790,6 +773,7 @@
            AND ss.visit_time &lt; DATE_ADD(#{endtime}, INTERVAL 1 DAY)
        </if>
        <if test="orgid != null and orgid != ''">AND ss.orgid = #{orgid}</if>
        <if test="campusid != null and campusid != ''">and ss.campusid = #{campusid}</if>
        <if test="deptcode != null  and deptcode != ''">and ss.deptcode = #{deptcode}</if>
        <if test="deptname != null  and deptname != ''">and ss.deptname = #{deptname}</if>
        <if test="isabnormal != null">and ss.isabnormal = #{isabnormal}</if>
@@ -1288,9 +1272,8 @@
        where 1=1
        <if test="patid != null ">and patid = #{patid}</if>
        <if test="taskid != null ">and taskid = #{taskid}</if>
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if>
        <if test="campusid != null and campusid != ''">and campusid = #{campusid}</if>
    </update>
    <update id="updateServiceSubtaskByCondition" parameterType="com.smartor.domain.ServiceSubtask">
@@ -1561,6 +1544,9 @@
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -1649,12 +1635,9 @@
        and a.del_flag = '0'
        and b.del_flag = '0'
        and a.appltype = '3'
        <if test="orgid != null and orgid != ''">
            and a.orgid = #{orgid}
        </if>
        <if test="taskId != null">
            and a.task_id = #{taskId}
        </if>
        <if test="orgid != null and orgid != ''">and a.orgid = #{orgid}</if>
        <if test="campusid != null and campusid != ''">and b.campusid = #{campusid}</if>
        <if test="taskId != null">and a.task_id = #{taskId}</if>
        <if test="taskName != null and taskName != ''">
            and a.task_name like concat('%', #{taskName}, '%')
        </if>
@@ -1743,6 +1726,9 @@
        and del_flag = 0
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
@@ -1845,6 +1831,9 @@
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -1940,6 +1929,9 @@
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -1984,6 +1976,9 @@
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -2015,6 +2010,9 @@
        and del_flag = 0
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">AND
            leavehospitaldistrictcode IN
@@ -2070,6 +2068,9 @@
        AND t.del_flag=0
        <if test="orgid != null and orgid != ''">
            and t.orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and t.campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND t.leavehospitaldistrictcode IN
@@ -2154,6 +2155,9 @@
        <if test="orgid != null and orgid != ''">
            AND ss.orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            AND ss.campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND ss.leavehospitaldistrictcode IN
            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -2210,6 +2214,9 @@
        and ss.del_flag=0
        <if test="orgid != null and orgid != ''">
            and ss.orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and ss.campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND ss.leavehospitaldistrictcode IN
@@ -2781,6 +2788,9 @@
        <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
@@ -2868,6 +2878,9 @@
        <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            AND campusid = #{campusid}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
            <foreach collection="leavehospitaldistrictcodes" item="code" open="(" separator="," close=")">
@@ -2893,6 +2906,9 @@
        AND deptcode IS NOT NULL AND deptcode != ''
        <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            AND campusid = #{campusid}
        </if>
        <if test="deptcodes != null and deptcodes.size() > 0">
            AND deptcode IN
@@ -2925,6 +2941,9 @@
        AND service_type = 4
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="sendstate != null">
            AND sendstate = #{sendstate}
@@ -3025,6 +3044,9 @@
        AND service_type = 4
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="campusid != null and campusid != ''">
            and campusid = #{campusid}
        </if>
        <if test="sendstate != null">
            AND sendstate = #{sendstate}
@@ -3215,21 +3237,22 @@
        SELECT questiontext,
        d.taskid,
        s.deptname,
        d.create_time as createTime,
        s.leavehospitaldistrictname,
        d.targetvalue,
        d.asrtext,
        COUNT(d.asrtext) AS answercount,
        SUM(d.score) AS singleScore
        d.score AS singleScore
        FROM service_subtask_detail d,
        service_task s
        WHERE d.taskid = s.taskid
        AND deptname IS NOT NULL
        AND leavehospitaldistrictname IS NOT NULL
        <if test="endFinishTime != null">
            AND create_time &lt; #{endFinishTime}
            AND d.create_time &lt; #{endFinishTime}
        </if>
        <if test="startFinishTime != null">
            AND create_time &gt;= #{startFinishTime}
            AND  d.create_time &gt;= #{startFinishTime}
        </if>
        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
@@ -3248,6 +3271,11 @@
        </if>
        GROUP BY d.questiontext,
        d.taskid,
        d.score,
        s.deptname,
        d.targetvalue,
        d.create_time,
        s.leavehospitaldistrictname,
        d.asrtext
        ORDER BY d.taskid
    </select>