package cherry.sqlapp.db.gen.mapper;

import cherry.sqlapp.db.gen.dto.AsyncProcessCommand;
import cherry.sqlapp.db.gen.dto.AsyncProcessCommandCriteria;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface AsyncProcessCommandMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @SelectProvider(type=AsyncProcessCommandSqlProvider.class, method="countByExample")
    int countByExample(AsyncProcessCommandCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @DeleteProvider(type=AsyncProcessCommandSqlProvider.class, method="deleteByExample")
    int deleteByExample(AsyncProcessCommandCriteria example);

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

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @Insert({
        "insert into ASYNC_PROCESS_COMMAND (ASYNC_ID, COMMAND, ",
        "UPDATED_AT, CREATED_AT, ",
        "LOCK_VERSION, DELETED_FLG)",
        "values (#{asyncId,jdbcType=BIGINT}, #{command,jdbcType=VARCHAR}, ",
        "#{updatedAt,jdbcType=TIMESTAMP}, #{createdAt,jdbcType=TIMESTAMP}, ",
        "#{lockVersion,jdbcType=INTEGER}, #{deletedFlg,jdbcType=INTEGER})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(AsyncProcessCommand record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @InsertProvider(type=AsyncProcessCommandSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(AsyncProcessCommand record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @SelectProvider(type=AsyncProcessCommandSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="ASYNC_ID", property="asyncId", jdbcType=JdbcType.BIGINT),
        @Result(column="COMMAND", property="command", jdbcType=JdbcType.VARCHAR),
        @Result(column="UPDATED_AT", property="updatedAt", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATED_AT", property="createdAt", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="LOCK_VERSION", property="lockVersion", jdbcType=JdbcType.INTEGER),
        @Result(column="DELETED_FLG", property="deletedFlg", jdbcType=JdbcType.INTEGER)
    })
    List<AsyncProcessCommand> selectByExampleWithRowbounds(AsyncProcessCommandCriteria example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @SelectProvider(type=AsyncProcessCommandSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="ASYNC_ID", property="asyncId", jdbcType=JdbcType.BIGINT),
        @Result(column="COMMAND", property="command", jdbcType=JdbcType.VARCHAR),
        @Result(column="UPDATED_AT", property="updatedAt", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATED_AT", property="createdAt", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="LOCK_VERSION", property="lockVersion", jdbcType=JdbcType.INTEGER),
        @Result(column="DELETED_FLG", property="deletedFlg", jdbcType=JdbcType.INTEGER)
    })
    List<AsyncProcessCommand> selectByExample(AsyncProcessCommandCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "ID, ASYNC_ID, COMMAND, UPDATED_AT, CREATED_AT, LOCK_VERSION, DELETED_FLG",
        "from ASYNC_PROCESS_COMMAND",
        "where ID = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="ID", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="ASYNC_ID", property="asyncId", jdbcType=JdbcType.BIGINT),
        @Result(column="COMMAND", property="command", jdbcType=JdbcType.VARCHAR),
        @Result(column="UPDATED_AT", property="updatedAt", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CREATED_AT", property="createdAt", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="LOCK_VERSION", property="lockVersion", jdbcType=JdbcType.INTEGER),
        @Result(column="DELETED_FLG", property="deletedFlg", jdbcType=JdbcType.INTEGER)
    })
    AsyncProcessCommand selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @UpdateProvider(type=AsyncProcessCommandSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") AsyncProcessCommand record, @Param("example") AsyncProcessCommandCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @UpdateProvider(type=AsyncProcessCommandSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") AsyncProcessCommand record, @Param("example") AsyncProcessCommandCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @UpdateProvider(type=AsyncProcessCommandSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(AsyncProcessCommand record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_COMMAND
     *
     * @mbggenerated
     */
    @Update({
        "update ASYNC_PROCESS_COMMAND",
        "set ASYNC_ID = #{asyncId,jdbcType=BIGINT},",
          "COMMAND = #{command,jdbcType=VARCHAR},",
          "UPDATED_AT = #{updatedAt,jdbcType=TIMESTAMP},",
          "CREATED_AT = #{createdAt,jdbcType=TIMESTAMP},",
          "LOCK_VERSION = #{lockVersion,jdbcType=INTEGER},",
          "DELETED_FLG = #{deletedFlg,jdbcType=INTEGER}",
        "where ID = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(AsyncProcessCommand record);
}