package com.bonus.sharedstation.app.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.sharedstation.app.domain.TherapyAppointments;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * 理疗预约信息表(TherapyAppointments)表数据库访问层
 *
 * @author makejava
 * @since 2024-12-10 10:47:02
 */
@Mapper
public interface TherapyAppointmentsMapper extends BaseMapper<TherapyAppointments> {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    TherapyAppointments queryById(Integer id);

    /**
     * 查询指定行数据
     *
     * @param therapyAppointments 查询条件
     * @param pageable         分页对象
     * @return 对象列表
     */
    List<TherapyAppointments> queryAllByLimit(TherapyAppointments therapyAppointments, @Param("pageable") Pageable pageable);

    /**
     * 统计总行数
     *
     * @param therapyAppointments 查询条件
     * @return 总行数
     */
    long count(TherapyAppointments therapyAppointments);

    /**
     * 新增数据
     *
     * @param therapyAppointments 实例对象
     * @return 影响行数
     */
    int insert(TherapyAppointments therapyAppointments);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<TherapyAppointments> 实例对象列表
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<TherapyAppointments> entities);

    /**
     * 批量新增或按主键更新数据（MyBatis原生foreach方法）
     *
     * @param entities List<TherapyAppointments> 实例对象列表
     * @return 影响行数
     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常，请自行校验入参
     */
    int insertOrUpdateBatch(@Param("entities") List<TherapyAppointments> entities);

    /**
     * 修改数据
     *
     * @param therapyAppointments 实例对象
     * @return 影响行数
     */
    int update(TherapyAppointments therapyAppointments);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 影响行数
     */
    int deleteById(Integer id);

}

