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

import java.util.List;

import net.wicp.tams.app.duckula.controller.bean.models.SysOrgRela;
import net.wicp.tams.app.duckula.controller.bean.models.SysPosition;
import net.wicp.tams.app.duckula.controller.bean.models.SysPositionExample;
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 SysPositionMapper extends BaseMapper<SysPosition>{

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

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

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

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

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

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

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

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

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

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

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