jiangqs
2023-07-15 b0b52cbabf7a4bc8e00fc328d14ac05336d0221e
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/task/ShopTaskMapper.xml
@@ -87,22 +87,36 @@
        </foreach>
    </delete>
    <select id="pageMgtAgencyFollow" resultType="com.ruoyi.shop.domain.vo.MgtAgencyTaskRecordPageVo">
        SELECT
        tmtr.user_id userId,
        tmtr.id followId,
        tmtr.task_id taskId,
        tmtr.create_time createTime,
        tmtr.follow_type followType,
        tmtr.call_time callTime,
        tmtr.follow_content followContent,
        tmtr.call_phone callPhone
        FROM t_agency_task tmt
        INNER JOIN t_agency_task_record tmtr ON tmtr.task_id = tmt.task_id
        WHERE tmt.del_flag = 0 AND tmt.agency_id = #{param.shopId}
        ORDER BY tmtr.create_time DESC
    <select id="getShopIngTotal" resultType="java.lang.Integer">
        SELECT COUNT(task_id)
        FROM t_shop_task
        WHERE del_flag = 0 AND task_status = 1
        <if test="shopIds!=null and shopIds!=''">
            AND  shop_id IN
            <foreach collection="shopIds" item="id" open="(" separator="," close=")">
                #{id}
            </foreach>
        </if>
        AND task_date = DATE(NOW())
    </select>
    <select id="pageStaffShopTask" resultType="com.ruoyi.shop.domain.vo.StaffShopTaskPageVo">
        SELECT
        tst.task_id taskId,
        tst.task_date taskDate,
        tst.follow_content taskContent,
        tst.emergency_state emergencyState,
        CASE WHEN tst.task_date = DATE(now()) THEN 1 ELSE 0 END todayFlag,
        tstr.user_id userId,
        tstr.create_time followTime
        FROM t_shop_task tst
        LEFT JOIN t_shop_task_record tstr ON tstr.task_id = tst.task_id
        WHERE tst.del_flag = 0 AND tst.shop_id = #{param.shopId} AND tstr.id = (SELECT MAX(id) FROM t_shop_task_record WHERE task_id = tst.task_id)
        <if test="param.taskStatus!=null and param.taskStatus != ''">
            AND tst.task_status = #{param.taskStatus}
        </if>
        ORDER BY tst.task_status ASC
    </select>
</mapper>