嗨森逛服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hai-server/hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java

67 lines
3.7 KiB

4 years ago
package com.hai.dao;
3 years ago
import com.hai.entity.HighGoldRec;
import com.hai.entity.HighGoldRecExample;
4 years ago
import org.apache.ibatis.annotations.Param;
3 years ago
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
4 years ago
import org.apache.ibatis.annotations.Select;
3 years ago
import org.apache.ibatis.type.JdbcType;
4 years ago
import java.util.List;
import java.util.Map;
4 years ago
/**
* mapper扩展类
*/
public interface HighGoldRecMapperExt {
4 years ago
@Select({"<script>" +
"SELECT" +
" gold_type , SUM(gold) AS sum FROM high_gold_rec" +
" WHERE" +
" 1 = 1" +
" <if test='map.createTimeS != null'> AND create_time BETWEEN '${map.createTimeS}' AND '${map.createTimeE}'</if> " +
" <if test='map.resType != null'> AND res_type = #{map.resType}</if> " +
" <if test='map.goldType != null'> AND gold_type = #{map.goldType}</if>" +
" GROUP BY gold_type" +
" </script>"})
// 查询申请记录
List<Map<Long,Long>> queryGold(@Param("map") Map<String,Object> map);
3 years ago
@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<HighGoldRec> 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<HighGoldRec> selectByExpiringSoonByAll(@Param("day") Integer day);
4 years ago
}