package com.crm.manager.dao.mapper;

import com.crm.rely.backend.core.entity.sales.SalesSalaryRecordListEntity;
import com.crm.rely.backend.core.pojo.table.SalesSalaryRecordTable;
import com.crm.rely.backend.core.pojo.view.SalesSalaryRecordView;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface SalesSalaryRecordMapper {

    void save(SalesSalaryRecordTable table);

    SalesSalaryRecordView findOne(Long id);

    Integer countSearch(SalesSalaryRecordListEntity entity);

    List<SalesSalaryRecordView> listSearch(SalesSalaryRecordListEntity entity);

    @Select("select * from sales_salary_record where serial=#{serial}")
    SalesSalaryRecordTable getBySerial(@Param("serial") String serial);

    @Update("update sales_salary_record set `status`=#{status},`note`=#{note},modify_time=#{modifyTime} where id=#{id}")
    void updateStatusById(SalesSalaryRecordTable salesSalaryRecordTable);
}
