package net.wicp.tams.app.duckula.controller.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import net.wicp.tams.app.duckula.controller.bean.models.SysOptgroup;
import net.wicp.tams.app.duckula.controller.bean.models.SysOptgroupExample;

public interface SysOptgroupMapper  extends BaseMapper<SysOptgroup> {

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	long countByExample(SysOptgroupExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	int deleteByExample(SysOptgroupExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	@Delete({ "delete from sys_optgroup", "where id = #{id,jdbcType=VARCHAR}" })
	int deleteByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	@Insert({ "insert into sys_optgroup (id, remark, ", "parent_id, is_edit, ", "is_valid)",
			"values (#{id,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, ",
			"#{parentId,jdbcType=VARCHAR}, #{isEdit,jdbcType=VARCHAR}, ", "#{isValid,jdbcType=VARCHAR})" })
	int insert(SysOptgroup record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	int insertSelective(SysOptgroup record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	List<SysOptgroup> selectByExample(SysOptgroupExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	@Select({ "select", "id, remark, parent_id, is_edit, is_valid", "from sys_optgroup",
			"where id = #{id,jdbcType=VARCHAR}" })
	@ResultMap("net.wicp.tams.app.duckula.controller.dao.SysOptgroupMapper.BaseResultMap")
	SysOptgroup selectByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	int updateByExampleSelective(@Param("record") SysOptgroup record, @Param("example") SysOptgroupExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	int updateByExample(@Param("record") SysOptgroup record, @Param("example") SysOptgroupExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	int updateByPrimaryKeySelective(SysOptgroup record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_optgroup
	 * @mbg.generated
	 */
	@Update({ "update sys_optgroup", "set remark = #{remark,jdbcType=VARCHAR},",
			"parent_id = #{parentId,jdbcType=VARCHAR},", "is_edit = #{isEdit,jdbcType=VARCHAR},",
			"is_valid = #{isValid,jdbcType=VARCHAR}", "where id = #{id,jdbcType=VARCHAR}" })
	int updateByPrimaryKey(SysOptgroup record);
}