package org.example.crm.workbench.mapper;

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

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

public interface ClueMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_clue
     *
     * @mbggenerated Mon Sep 04 07:46:29 CST 2023
     */
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_clue
     *
     * @mbggenerated Mon Sep 04 07:46:29 CST 2023
     */
    int insert(Clue record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_clue
     *
     * @mbggenerated Mon Sep 04 07:46:29 CST 2023
     */
    int insertSelective(Clue record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_clue
     *
     * @mbggenerated Mon Sep 04 07:46:29 CST 2023
     */
    Clue selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_clue
     *
     * @mbggenerated Mon Sep 04 07:46:29 CST 2023
     */
    int updateByPrimaryKeySelective(Clue record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tbl_clue
     *
     * @mbggenerated Mon Sep 04 07:46:29 CST 2023
     */
    int updateByPrimaryKey(Clue record);

    /**
     * 保存创建的线索
     * @param clue
     * @return
     */
    int insertClue(Clue clue);

    /**
     * 根据条件查询线索并分页
     * @param map
     * @return
     */
    List<Clue> selectClueByConditionForPage(Map<String,Object> map);

    /**
     * 根据条件查询线索总条数
     * @param map
     * @return
     */
    Integer selectCountOfClueByCondition(Map<String,Object> map);

    /**
     * 根据 id 数组批量删除线索
     * @param ids
     * @return
     */
    int deleteClueByIds(String[] ids);

    /**
     * 根据 id 查询线索，显示在修改模态窗口
     * @param id
     * @return
     */
    Clue selectClueById(String id);

    /**
     * 修改线索
     * @param clue
     * @return
     */
    int updateClue(Clue clue);

    /**
     * 根据 id 查询线索，用于展示线索明细
     * @param id
     * @return
     */
    Clue selectDetailClueById(String id);

    /**
     * 根据 id 删除线索
     * @param id
     * @return
     */
    int deleteClueById(String id);
}