package com.zbf.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbf.system.domain.TRkWareNoticeTabBak;
import com.zbf.system.domain.TRkXnWareNoticeTabBak;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * 入库通知单明细备份Mapper接口
 *
 * @author tony
 * @date 2024-06-14
 */
public interface TRkXnWareNoticeTabBakMapper extends BaseMapper<TRkXnWareNoticeTabBak> //修改
{

    @Select("SELECT COALESCE(SUM(total_money), 0) FROM t_rk_ware_notice_tab_bak WHERE YEAR(create_time) = #{year} AND MONTH(create_time) = #{month}")
    BigDecimal getTotalMoneyForYearMonth(@Param("year") int year, @Param("month") int month);


    @Select("SELECT COALESCE(SUM(total_money), 0) FROM t_rk_ware_notice_tab_bak WHERE YEAR(create_time) = #{year} AND MONTH(create_time) = #{month} and not level_type = '1'")
    BigDecimal getTotalMoneyForYearMonth1(@Param("year") int year, @Param("month") int month);

    @Select("SELECT COALESCE(SUM(total_money), 0) FROM t_rk_ware_notice_tab_bak WHERE YEAR(create_time) = #{year} AND MONTH(create_time) = #{month} and level_type = '1'")
    BigDecimal getTotalMoneyForYearMonth2(@Param("year") int year, @Param("month") int month);
    /**
     * 查询入库通知单明细备份
     *
     * @param id 入库通知单明细备份主键
     * @return 入库通知单明细备份
     */
    public TRkXnWareNoticeTabBak selectTRkWareNoticeTabBakById(String id);

    /**
     * 查询入库通知单明细备份列表
     *
     * @param tRkWareNoticeTabBak 入库通知单明细备份
     * @return 入库通知单明细备份集合
     */
    public List<TRkXnWareNoticeTabBak> selectTRkWareNoticeTabBakList(TRkXnWareNoticeTabBak tRkWareNoticeTabBak);

    public List<TRkXnWareNoticeTabBak> selectTRkWareNoticeTabBakLists();

    /**
     * 新增入库通知单明细备份
     *
     * @param tRkWareNoticeTabBak 入库通知单明细备份
     * @return 结果
     */
    public int insertTRkWareNoticeTabBak(TRkXnWareNoticeTabBak tRkWareNoticeTabBak);

    /**
     * 修改入库通知单明细备份
     *
     * @param tRkWareNoticeTabBak 入库通知单明细备份
     * @return 结果
     */
    public int updateTRkWareNoticeTabBak(TRkXnWareNoticeTabBak tRkWareNoticeTabBak);

    public List<TRkXnWareNoticeTabBak> select(TRkXnWareNoticeTabBak tRkWareNoticeTabBak);

    /**
     * 删除入库通知单明细备份
     *
     * @param id 入库通知单明细备份主键
     * @return 结果
     */
    public int deleteTRkWareNoticeTabBakById(String id);

    /**
     * 批量删除入库通知单明细备份
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTRkWareNoticeTabBakByIds(String[] ids);

    /**
     * 批量启用入库通知单明细备份
     *
     * @param ids 需要启用的数据主键集合
     * @return 结果
     */
    public int enableTRkWareNoticeTabBakByIds(String[] ids);

    /**
     * 批量禁用入库通知单明细备份
     *
     * @param ids 需要禁用的数据主键集合
     * @return 结果
     */
    public int disabledTRkWareNoticeTabBakByIds(String[] ids);


}
