package com.goafanti.common.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.goafanti.business.bo.JtBusinessCategoryBo;
import com.goafanti.business.bo.JtBusinessCategoryTree;
import com.goafanti.common.model.JtBusinessCategory;
import com.goafanti.common.model.JtBusinessCategoryExample;

public interface JtBusinessCategoryMapper {
    /**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	long countByExample(JtBusinessCategoryExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	int deleteByExample(JtBusinessCategoryExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	int deleteByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	int insert(JtBusinessCategory record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	int insertSelective(JtBusinessCategory record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	List<JtBusinessCategory> selectByExample(JtBusinessCategoryExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	JtBusinessCategory selectByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	int updateByExampleSelective(@Param("record") JtBusinessCategory record,
			@Param("example") JtBusinessCategoryExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	int updateByExample(@Param("record") JtBusinessCategory record,
			@Param("example") JtBusinessCategoryExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	int updateByPrimaryKeySelective(JtBusinessCategory record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_business_category
	 * @mbg.generated  Tue Jul 17 09:14:43 CST 2018
	 */
	int updateByPrimaryKey(JtBusinessCategory record);

	JtBusinessCategory getBusinessCategoryByLayerAndName(Integer layer, String name);
    
    List<JtBusinessCategory> getBusinessCategoryBySuperId(@Param("superId")String superId,@Param("size")Integer size);
    
    JtBusinessCategoryTree getCategoryTree(String id);
    
    List<JtBusinessCategoryBo>getCategoryBoList(@Param("module")Integer module);
    
    int insertCategory(JtBusinessCategory jtBusinessCategory);
    
    int autoIncreaseSort(Integer layer,Integer sort);
    
    String getCurrentMaxNumber(JtBusinessCategory jtBusinessCategory);
    String getCurrentMinNumber(JtBusinessCategory jtBusinessCategory);
    
    Integer updateNumberPrefix(JtBusinessCategory jtBusinessCategory);
    
    List<JtBusinessCategory> getCategoryByModule(@Param("module")Integer module,@Param("layer")Integer layer,@Param("size")Integer size);

	JtBusinessCategory selectFirstLevel(String id, Integer module, String superId,@Param("type")Integer type);
	
	List<JtBusinessCategory> getCategoryByName(JtBusinessCategory category);
	List<JtBusinessCategory> getCategoryByModel(JtBusinessCategory category);

	List<JtBusinessCategoryBo> getHomeIndex(Integer module, Integer isHome);
	
	int getCountBySome(JtBusinessCategory category);
    
}