package com.fs.hospital.mapper;

import java.util.List;
import com.fs.hospital.domain.HospitalOrderItemLogs;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * orderItemLogsMapper接口
 *
 * @author fs
 * @date 2024-06-07
 */

@Repository
public interface HospitalOrderItemLogsMapper
{

    /**
     * 查询orderItemLogs列表
     *
     * @param treatOrderId treatOrderId
     * @return orderItemLogs集合
     */
    @Select("select il.treat_order_id, il.execute_item ,il.create_time, u.user_name from hospital_order_item_logs il " +
            "left join hospital_user u on il.user_id=u.user_id " +
            "where treat_order_id=#{treatOrderId} order by create_time desc")
    public List<HospitalOrderItemLogs> selectHospitalOrderItemLogsListByTreatOrderId(@Param("treatOrderId") Long treatOrderId);

    /**
     * 新增orderItemLogs
     *
     * @param hospitalOrderItemLogs orderItemLogs
     * @return 结果
     */
    public int insertHospitalOrderItemLogs(HospitalOrderItemLogs hospitalOrderItemLogs);
}
