package org.example.crm.workbench.mapper;

import org.example.crm.workbench.domain.Customer;

import java.util.List;
import java.util.Map;

public interface CustomerMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_customer
     *
     * @mbggenerated Sat Sep 09 21:50:26 CST 2023
     */
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_customer
     *
     * @mbggenerated Sat Sep 09 21:50:26 CST 2023
     */
    int insert(Customer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_customer
     *
     * @mbggenerated Sat Sep 09 21:50:26 CST 2023
     */
    int insertSelective(Customer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_customer
     *
     * @mbggenerated Sat Sep 09 21:50:26 CST 2023
     */
    Customer selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_customer
     *
     * @mbggenerated Sat Sep 09 21:50:26 CST 2023
     */
    int updateByPrimaryKeySelective(Customer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_customer
     *
     * @mbggenerated Sat Sep 09 21:50:26 CST 2023
     */
    int updateByPrimaryKey(Customer record);

    /**
     * 保存创建的客户
     * @param customer
     * @return
     */
    int insertCustomer(Customer customer);

    /**
     * 分页查询客户
     * @param map
     * @return
     */
    List<Customer> selectCustomerByConditionForPage(Map<String,Object> map);

    int selectCountOfCustomerByCondition(Map<String,Object> map);

    /**
     * 根据 name 模糊查询客户
     * @param name
     * @return
     */
    List<Customer> selectCustomerByName(String name);

    /**
     * 根据 id 查询客户，显示在修改界面
     * @param id
     * @return
     */
    Customer selectCustomerById(String id);

    int updateCustomer(Customer customer);

    /**
     * 跳转至客户明细界面
     * @param id
     * @return
     */
    Customer selectCustomerForDetailById(String id);

    Customer selectCustomerIdByName(String name);
}