陈昶聿
15 小时以前 75dd91a2aa8682d458fd3dc6df6a52feb43a0c89
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -361,6 +361,41 @@
                </foreach>
            </if>
        </if>
        <if test="deptOrDistrict==3">
            <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
                AND (leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
                         separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test=" visitDeptCodes != null and visitDeptCodes.size()>0">
                and visit_dept_code IN
                <foreach collection="visitDeptCodes" item="visitDeptCode" open="(" separator=","
                         close="))">
                    #{visitDeptCode}
                </foreach>
            </if>
        </if>
        <if test="deptOrDistrict==4">
            <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
                AND (leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
                         separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            </if>
            <if test=" visitDeptCodes != null and visitDeptCodes.size()>0">
                OR visit_dept_code IN
                <foreach collection="visitDeptCodes" item="visitDeptCode" open="(" separator=","
                         close="))">
                    #{visitDeptCode}
                </foreach>
            </if>
        </if>
        <if test="visitTime != null">
            AND date_format(visit_time,'%y%m%d') = date_format(#{visitTime},'%y%m%d')
@@ -425,12 +460,13 @@
        </if>
        <if test="sort != null  and sort==0">order by endtime asc</if>
        <if test="sort != null  and sort==1">order by endtime desc</if>
        <if test="sort != null  and sort==2">order by long_send_time asc</if>
        <if test="sort != null  and sort==3">order by long_send_time desc</if>
        <if test="sort != null  and sort==2">order by visit_time asc</if>
        <if test="sort != null  and sort==3">order by visit_time desc</if>
        <if test="sort != null  and sort==5">order by admindate asc</if>
        <if test="sort != null  and sort==6">order by admindate desc</if>
        <if test="sort != null  and sort==7">order by visit_time asc</if>
        <if test="sort != null  and sort==8">order by visit_time desc</if>
        <if test="sort != null  and sort==9">order by sendname asc</if>
        <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
    </select>
    <select id="getCompensateServiceSubtaskList" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity"
@@ -615,6 +651,12 @@
        </if>
        <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if>
        <if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if>
        <if test="visitCount != null and visitCount == 1">
            AND visit_count = 1
        </if>
        <if test="visitCount != null and visitCount > 1">
            AND visit_count > 1
        </if>
        <if test="groupKey != null and groupKey != ''">
            AND ${groupKey} IN
            <foreach collection="groupKeyList" item="key" open="(" separator=","
@@ -1357,6 +1399,12 @@
        <if test="type != null">
            and type = #{type}
        </if>
        <if test="visitCount != null and visitCount == 1">
            AND visit_count = 1
        </if>
        <if test="visitCount != null and visitCount > 1">
            AND visit_count > 1
        </if>
        <if test="groupKey != null and groupKey != '' and groupKeyList != null and groupKeyList.size>0">
            AND ${groupKey} IN
            <foreach collection="groupKeyList" item="key" open="(" separator=","
@@ -1412,6 +1460,12 @@
        <!-- 目前只统计语音和问卷 -->
        <if test="type != null">
            and type = #{type}
        </if>
        <if test="visitCount != null and visitCount == 1">
            AND visit_count = 1
        </if>
        <if test="visitCount != null and visitCount > 1">
            AND visit_count > 1
        </if>
        <if test="groupKey != null and groupKey != ''">
            group by ${groupKey}
@@ -1859,6 +1913,9 @@
        FROM service_subtask
        WHERE DATE_FORMAT(finishtime, '%Y-%m-%d') >= #{startDate}
          AND DATE_FORMAT(finishtime, '%Y-%m-%d') &lt;= #{endDate}
        <if test="orgid != null">
            AND orgid = #{orgid}
        </if>
        GROUP BY deptname
    </select>
@@ -2201,6 +2258,9 @@
        <if test="excep != null ">
            AND excep = #{excep}
        </if>
        <if test="taskName != null  and taskName != ''">
            AND task_name like concat('%', #{taskName}, '%')
        </if>
        <if test="visitCount != null and visitCount == 1">
            AND visit_count = 1
        </if>