package com.hfkj.dao;

import com.hfkj.entity.AuditMsg;
import com.hfkj.entity.AuditMsgExample;
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.type.JdbcType;
import org.springframework.stereotype.Repository;

/**
 * 
 * 代码由工具生成,请勿修改!!!
 * 如果需要扩展请在其父类进行扩展
 * 
 **/
@Repository
public interface AuditMsgMapper extends AuditMsgMapperExt {
    @SelectProvider(type=AuditMsgSqlProvider.class, method="countByExample")
    long countByExample(AuditMsgExample example);

    @DeleteProvider(type=AuditMsgSqlProvider.class, method="deleteByExample")
    int deleteByExample(AuditMsgExample example);

    @Delete({
        "delete from audit_msg",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into audit_msg (`type`, submit_object_id, ",
        "submit_object_name, submit_op_name, ",
        "submit_op_id, audit_serial_no, ",
        "remarks, create_time, ",
        "update_time, audit_op_id, ",
        "audit_op_name, `status`, ",
        "ext_1, ext_2, ext_3)",
        "values (#{type,jdbcType=INTEGER}, #{submitObjectId,jdbcType=BIGINT}, ",
        "#{submitObjectName,jdbcType=VARCHAR}, #{submitOpName,jdbcType=VARCHAR}, ",
        "#{submitOpId,jdbcType=BIGINT}, #{auditSerialNo,jdbcType=VARCHAR}, ",
        "#{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{auditOpId,jdbcType=BIGINT}, ",
        "#{auditOpName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(AuditMsg record);

    @InsertProvider(type=AuditMsgSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(AuditMsg record);

    @SelectProvider(type=AuditMsgSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="submit_object_id", property="submitObjectId", jdbcType=JdbcType.BIGINT),
        @Result(column="submit_object_name", property="submitObjectName", jdbcType=JdbcType.VARCHAR),
        @Result(column="submit_op_name", property="submitOpName", jdbcType=JdbcType.VARCHAR),
        @Result(column="submit_op_id", property="submitOpId", jdbcType=JdbcType.BIGINT),
        @Result(column="audit_serial_no", property="auditSerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="audit_op_id", property="auditOpId", jdbcType=JdbcType.BIGINT),
        @Result(column="audit_op_name", property="auditOpName", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    List<AuditMsg> selectByExample(AuditMsgExample example);

    @Select({
        "select",
        "id, `type`, submit_object_id, submit_object_name, submit_op_name, submit_op_id, ",
        "audit_serial_no, remarks, create_time, update_time, audit_op_id, audit_op_name, ",
        "`status`, ext_1, ext_2, ext_3",
        "from audit_msg",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="submit_object_id", property="submitObjectId", jdbcType=JdbcType.BIGINT),
        @Result(column="submit_object_name", property="submitObjectName", jdbcType=JdbcType.VARCHAR),
        @Result(column="submit_op_name", property="submitOpName", jdbcType=JdbcType.VARCHAR),
        @Result(column="submit_op_id", property="submitOpId", jdbcType=JdbcType.BIGINT),
        @Result(column="audit_serial_no", property="auditSerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="audit_op_id", property="auditOpId", jdbcType=JdbcType.BIGINT),
        @Result(column="audit_op_name", property="auditOpName", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    AuditMsg selectByPrimaryKey(Long id);

    @UpdateProvider(type=AuditMsgSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") AuditMsg record, @Param("example") AuditMsgExample example);

    @UpdateProvider(type=AuditMsgSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") AuditMsg record, @Param("example") AuditMsgExample example);

    @UpdateProvider(type=AuditMsgSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(AuditMsg record);

    @Update({
        "update audit_msg",
        "set `type` = #{type,jdbcType=INTEGER},",
          "submit_object_id = #{submitObjectId,jdbcType=BIGINT},",
          "submit_object_name = #{submitObjectName,jdbcType=VARCHAR},",
          "submit_op_name = #{submitOpName,jdbcType=VARCHAR},",
          "submit_op_id = #{submitOpId,jdbcType=BIGINT},",
          "audit_serial_no = #{auditSerialNo,jdbcType=VARCHAR},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "audit_op_id = #{auditOpId,jdbcType=BIGINT},",
          "audit_op_name = #{auditOpName,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(AuditMsg record);
}