liusheng
4 天以前 2212759d051a0f60b4f0ada73d678cf150e29c84
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -75,6 +75,7 @@
        <result property="tagname" column="tagname"/>
        <result property="visitTime" column="visit_time"/>
        <result property="leavediagname" column="leavediagname"/>
        <result property="outPath" column="out_path"/>
    </resultMap>
    <resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2">
@@ -87,6 +88,7 @@
    <sql id="selectServiceSubtaskVo">
        select id,
               hosp_type,
               out_path,
               suggest,
               sendstate,
               endtime,
@@ -97,6 +99,7 @@
               inhospid,
               drname,
               excep,
               tagname,
               drcode,
               long_send_time,
               openid,
@@ -165,6 +168,7 @@
            del_flag=0
            <if test="sendname != null  and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if>
            <if test="phone != null  and phone != ''">and phone = #{phone}</if>
            <if test="outPath != null  and outPath != ''">and out_path = #{outPath}</if>
            <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">and
                leavehospitaldistrictcode = #{leavehospitaldistrictcode}
            </if>
@@ -177,7 +181,7 @@
            <if test="sex != null  and sex != ''">and sex = #{sex}</if>
            <if test="age != null ">and age = #{age}</if>
            <if test="patguid != null ">and patguid = #{patguid}</if>
            <if test="subId != null ">and id = #{subId}</if>
            <if test="subid != null ">and id = #{subid}</if>
            <if test="inhospid != null ">and inhospid = #{inhospid}</if>
            <if test="submit != null ">and submit = #{submit}</if>
            <if test="upid != null ">and upid = #{upid}</if>
@@ -279,7 +283,8 @@
            <if test="endtime != null ">and endtime = #{endtime}</if>
            <if test="excep != null ">and excep = #{excep}</if>
            <if test="nurseName != null ">and nurse_name = #{nurseName}</if>
            <if test="score != null">and score = #{score}</if>
            <if test="scoreStart != null">and score &gt;= #{scoreStart}</if>
            <if test="scoreEnd != null">and score &lt;= #{scoreEnd}</if>
            <!--            <if test="visitCount != null">and visit_count = #{visitCount}</if>-->
            <if test="visitCount != null and visitCount == 1">
                AND visit_count = 1
@@ -293,8 +298,6 @@
            <if test="taskGuid != null">and task_guid = #{taskGuid}</if>
            <if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</if>
            <if test="visitTime != null">and visit_time = #{visitTime}</if>
            <!--<if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if>
            <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if>-->
            <if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0">
                AND visit_dept_code IN
                <foreach collection="visitDeptCodes" item="visitDeptCodes" open="("
@@ -310,8 +313,7 @@
        <if test="sort != null  and sort==3">order by long_send_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>
        <!-- order by update_time desc,id desc -->
        <if test="pageNum != null and pageSize != null">limit #{pageNum},#{pageSize}</if>
    </select>
@@ -404,6 +406,8 @@
            <if test="inhospid != null ">inhospid,</if>
            <if test="visitTime != null ">visit_time,</if>
            <if test="leavediagname != null ">leavediagname,</if>
            <if test="outPath != null">out_path,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="sendname != null">#{sendname},</if>
@@ -477,6 +481,8 @@
            <if test="inhospid != null ">#{inhospid},</if>
            <if test="visitTime != null ">#{visitTime},</if>
            <if test="leavediagname != null ">#{leavediagname},</if>
            <if test="outPath != null">#{outPath},</if>
        </trim>
    </insert>
@@ -554,6 +560,7 @@
            <if test="inhospid != null ">inhospid=#{inhospid},</if>
            <if test="visitTime != null ">visit_time=#{visitTime},</if>
            <if test="leavediagname != null ">leavediagname=#{leavediagname},</if>
            <if test="outPath != null">out_path = #{outPath},</if>
        </trim>
        where id = #{id}
    </update>
@@ -632,11 +639,13 @@
            <if test="inhospid != null ">inhospid=#{inhospid},</if>
            <if test="visitTime != null ">visitTime=#{visitTime},</if>
            <if test="delFlag != null ">del_flag=#{delFlag},</if>
            <if test="outPath != null ">out_path = #{outPath},</if>
        </trim>
        <where>
            <if test="patid != null ">patid=#{patid}</if>
            <if test="taskid != null ">and taskid=#{taskid}</if>
            <if test="leavediagname != null ">and leavediagname=#{leavediagname}</if>
            <if test="outPath != null  and outPath != ''">and out_path = #{outPath}</if>
        </where>
    </update>
@@ -714,6 +723,7 @@
            <if test="inhospid != null ">inhospid=#{inhospid},</if>
            <if test="visitTime != null ">visit_time=#{visitTime},</if>
            <if test="leavediagname != null ">leavediagname=#{leavediagname},</if>
            <if test="outPath != null">out_path = #{outPath},</if>
        </trim>
        where patid = #{patid} and taskid = #{taskid}
    </update>
@@ -826,6 +836,7 @@
               remark,
               visit_time,
               leavediagname,
               out_path,
               diagname
        FROM service_subtask,
             JSON_TABLE(send_time_slot, '$[*]' COLUMNS (
@@ -900,8 +911,8 @@
        WHERE
        del_flag = '0'
        <if test="startDate != null and endDate != null">
            AND  visit_time  &gt;=  #{startDate}
            AND  visit_time  &lt;=  #{endDate}
            AND visit_time &gt;= #{startDate}
            AND visit_time &lt;= #{endDate}
        </if>
        <if test="orgid != null">
@@ -976,8 +987,8 @@
        FROM pat_med_inhosp
        WHERE del_flag = '0'
        <if test="startDate != null and endDate != null">
            AND endtime  &gt;=  #{startDate}
            AND  endtime  &lt;=  #{endDate}
            AND endtime &gt;= #{startDate}
            AND endtime &lt;= #{endDate}
        </if>
        AND inhospstate=1
@@ -1082,6 +1093,5 @@
        GROUP BY timePeriod
        ORDER BY timePeriod DESC
    </select>
</mapper>