<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.stylefeng.guns.modular.system.dao.UserRedPacketRecordMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.UserRedPacketRecord">
|
<id column="id" property="id"/>
|
<result column="money" property="money"/>
|
<result column="expirationTime" property="expirationTime"/>
|
<result column="insertTime" property="insertTime"/>
|
<result column="companyId" property="companyId"/>
|
<result column="state" property="state"/>
|
<result column="orderId" property="orderId"/>
|
<result column="orderType" property="orderType"/>
|
<result column="userId" property="userId"/>
|
</resultMap>
|
|
|
|
<select id="query" resultType="UserRedPacketRecord">
|
select
|
id as id,
|
money as money,
|
expirationTime as expirationTime,
|
insertTime as insertTime,
|
companyId as companyId,
|
state as state,
|
orderId as orderId,
|
orderType as orderType,
|
userId as userId
|
from t_user_red_packet_record where 1=1
|
<if test="null != uid">
|
and userId = #{uid}
|
</if>
|
<if test="null != companyId">
|
and companyId = #{companyId}
|
</if>
|
<if test="null != state">
|
and state = #{state}
|
</if>
|
<if test="null != orderType">
|
and orderType = #{orderType}
|
</if>
|
<if test="null != money">
|
and money <= #{money}
|
</if>
|
order by money desc limit 0, 1
|
</select>
|
|
|
|
</mapper>
|