package com.crm.manager.dao.mapper;

import com.crm.rely.backend.core.entity.sys.SysSalesLoginSearchListEntity;
import com.crm.rely.backend.core.pojo.table.SysSalesLoginTable;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface SysSalesLoginMapper {

    @Select("select * from sys_sales_login where id=#{id}")
    SysSalesLoginTable findById(Long id);

    @Insert("insert into sys_sales_login(login,ib_no,add_time,note) values(#{login},#{ibNo},#{addTime},#{note})")
    void save(SysSalesLoginTable sysSalesLogin);

    @Update("update sys_sales_login set login=#{login},ib_no=#{ibNo},modify_time=#{modifyTime},note=#{note} where id=#{id}")
    void update(SysSalesLoginTable sysSalesLogin);

    @Delete("delete from sys_sales_login where id=#{id}")
    void removeById(Long id);

    Integer countSearch(SysSalesLoginSearchListEntity entity);

    List<SysSalesLoginTable> listSearch(SysSalesLoginSearchListEntity entity);

    @Select("select * from sys_sales_login where login = #{login}")
    SysSalesLoginTable findByLogin(Long login);
}
