package com.zbf.system.mapper;

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

import com.baomidou.mybatisplus.core.mapper.BaseMapper; //添加
import com.zbf.system.domain.TRkWareNoticeTab;
import com.zbf.system.domain.TRkWareNoticeTabBak;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

    @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 TRkWareNoticeTabBak selectTRkWareNoticeTabBakById(String id);

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

    public List<TRkWareNoticeTabBak> selectTRkWareNoticeTabBakLists();

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

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

    public List<TRkWareNoticeTabBak> select(TRkWareNoticeTabBak 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);


}
