liusheng
5 天以前 6659135780e718758417efde4c8c351c69e3755b
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -197,12 +197,16 @@
        <include refid="selectServiceSubtaskVo"/>
        <where>
            del_flag=0
            and taskid = #{taskid}
            AND sendstate IN
            <foreach collection="sendstates" item="sendstate" open="(" separator=","
                     close=")">
                #{sendstate}
            </foreach>
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="serviceType != null ">and service_type = #{serviceType}</if>
            <if test="patid != null ">and patid = #{patid}</if>
            <if test="sendstates!=null">
                AND sendstate IN
                <foreach collection="sendstates" item="sendstate" open="(" separator=","
                         close=")">
                    #{sendstate}
                </foreach>
            </if>
        </where>
    </select>
@@ -552,6 +556,20 @@
        where id = #{id}
    </select>
    <select id="selectServiceSubtaskByDiagname" parameterType="com.smartor.domain.ServiceSubtask"
            resultMap="ServiceSubtaskResult">
        select sendstate,starttime,endtime,nurse_name,phone,sex,task_name,sendname,leavediagname,visit_time FROM
        service_subtask WHERE del_flag=0
        <if test="leavediagname != null">and leavediagname like concat('%',#{leavediagname}, '%')</if>
        <if test="sendname != null">and sendname like concat('%',#{sendname}, '%')</if>
        <if test="taskName != null">and task_name like concat('%',#{taskName}, '%')</if>
        <if test="sendstate != null">and sendstate = #{sendstate}</if>
        <if test="orgid != null">and orgid =#{orgid}</if>
        GROUP BY sendname,sendstate,starttime,endtime,nurse_name,phone,sex,task_name,leavediagname,visit_time ORDER BY
        visit_time
        <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
    </select>
    <insert id="insertServiceSubtask" parameterType="com.smartor.domain.ServiceSubtask" useGeneratedKeys="true"
            keyProperty="id">
        insert into service_subtask