package cn.skcks.matrix.v2.orm.mybatis.basic.mapper;

import cn.skcks.matrix.v2.orm.mybatis.basic.model.CasbinRule;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

public interface CasbinRuleMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table casbin_rule
     *
     * @mbg.generated
     */
    @Delete({
        "delete from casbin_rule",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table casbin_rule
     *
     * @mbg.generated
     */
    @Insert({
        "insert into casbin_rule (id, ptype, ",
        "v0, v1, v2, ",
        "v3, v4, v5)",
        "values (#{id,jdbcType=INTEGER}, #{ptype,jdbcType=VARCHAR}, ",
        "#{v0,jdbcType=VARCHAR}, #{v1,jdbcType=VARCHAR}, #{v2,jdbcType=VARCHAR}, ",
        "#{v3,jdbcType=VARCHAR}, #{v4,jdbcType=VARCHAR}, #{v5,jdbcType=VARCHAR})"
    })
    int insert(CasbinRule row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table casbin_rule
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "id, ptype, v0, v1, v2, v3, v4, v5",
        "from casbin_rule",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="ptype", property="ptype", jdbcType=JdbcType.VARCHAR),
        @Result(column="v0", property="v0", jdbcType=JdbcType.VARCHAR),
        @Result(column="v1", property="v1", jdbcType=JdbcType.VARCHAR),
        @Result(column="v2", property="v2", jdbcType=JdbcType.VARCHAR),
        @Result(column="v3", property="v3", jdbcType=JdbcType.VARCHAR),
        @Result(column="v4", property="v4", jdbcType=JdbcType.VARCHAR),
        @Result(column="v5", property="v5", jdbcType=JdbcType.VARCHAR)
    })
    CasbinRule selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table casbin_rule
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "id, ptype, v0, v1, v2, v3, v4, v5",
        "from casbin_rule"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="ptype", property="ptype", jdbcType=JdbcType.VARCHAR),
        @Result(column="v0", property="v0", jdbcType=JdbcType.VARCHAR),
        @Result(column="v1", property="v1", jdbcType=JdbcType.VARCHAR),
        @Result(column="v2", property="v2", jdbcType=JdbcType.VARCHAR),
        @Result(column="v3", property="v3", jdbcType=JdbcType.VARCHAR),
        @Result(column="v4", property="v4", jdbcType=JdbcType.VARCHAR),
        @Result(column="v5", property="v5", jdbcType=JdbcType.VARCHAR)
    })
    List<CasbinRule> selectAll();

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table casbin_rule
     *
     * @mbg.generated
     */
    @Update({
        "update casbin_rule",
        "set ptype = #{ptype,jdbcType=VARCHAR},",
          "v0 = #{v0,jdbcType=VARCHAR},",
          "v1 = #{v1,jdbcType=VARCHAR},",
          "v2 = #{v2,jdbcType=VARCHAR},",
          "v3 = #{v3,jdbcType=VARCHAR},",
          "v4 = #{v4,jdbcType=VARCHAR},",
          "v5 = #{v5,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(CasbinRule row);
}
