package com.hai.dao; import com.hai.entity.HighGoldRec; import com.hai.entity.HighGoldRecExample; 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.type.JdbcType; import java.util.List; import java.util.Map; /** * mapper扩展类 */ public interface HighGoldRecMapperExt { @Select({""}) // 查询申请记录 List> queryGold(@Param("map") Map map); @Select("select * from high_gold_rec WHERE status = 1 and res_type = 4 and DATE_ADD(create_time,INTERVAL #{day} DAY) < NOW() and user_id = #{userId} ") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="gold_type", property="goldType", jdbcType=JdbcType.BIGINT), @Result(column="gold", property="gold", jdbcType=JdbcType.INTEGER), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="res_type", property="resType", jdbcType=JdbcType.INTEGER), @Result(column="res_id", property="resId", jdbcType=JdbcType.BIGINT), @Result(column="remark", property="remark", 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 selectByExpiringSoon(@Param("userId") Long userId , @Param("day") Integer day); @Select("select * from high_gold_rec WHERE status = 1 and res_type = 4 and DATE_ADD(create_time,INTERVAL #{day} DAY) < NOW()") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="gold_type", property="goldType", jdbcType=JdbcType.BIGINT), @Result(column="gold", property="gold", jdbcType=JdbcType.INTEGER), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="res_type", property="resType", jdbcType=JdbcType.INTEGER), @Result(column="res_id", property="resId", jdbcType=JdbcType.BIGINT), @Result(column="remark", property="remark", 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 selectByExpiringSoonByAll(@Param("day") Integer day); }