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

import java.util.List;

import net.wicp.tams.app.duckula.controller.bean.models.SysGlobal;
import net.wicp.tams.app.duckula.controller.bean.models.SysGroup;
import net.wicp.tams.app.duckula.controller.bean.models.SysGroupExample;
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;

public interface SysGroupMapper extends BaseMapper<SysGroup>{

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_group
	 * @mbg.generated
	 */
	@Insert({ "insert into sys_group (id, group_name, ", "org_id, tenant_id)",
			"values (#{id,jdbcType=BIGINT}, #{groupName,jdbcType=VARCHAR}, ",
			"#{orgId,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT})" })
	int insert(SysGroup record);

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_group
	 * @mbg.generated
	 */
	@Select({ "select", "id, group_name, org_id, tenant_id", "from sys_group", "where id = #{id,jdbcType=BIGINT}" })
	@ResultMap("net.wicp.tams.app.duckula.controller.dao.SysGroupMapper.BaseResultMap")
	SysGroup selectByPrimaryKey(Long id);

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

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

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

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table sys_group
	 * @mbg.generated
	 */
	@Update({ "update sys_group", "set group_name = #{groupName,jdbcType=VARCHAR},",
			"org_id = #{orgId,jdbcType=BIGINT},", "tenant_id = #{tenantId,jdbcType=BIGINT}",
			"where id = #{id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(SysGroup record);
}