<?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.PaymentRecordMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.PaymentRecord">
|
<id column="id" property="id"/>
|
<result column="category" property="category"/>
|
<result column="userId" property="userId"/>
|
<result column="type" property="type"/>
|
<result column="orderId" property="orderId"/>
|
<result column="orderType" property="orderType"/>
|
<result column="payType" property="payType"/>
|
<result column="amount" property="amount"/>
|
<result column="code" property="code"/>
|
<result column="state" property="state"/>
|
<result column="insertTime" property="insertTime"/>
|
</resultMap>
|
|
|
<select id="query" resultType="PaymentRecord">
|
select
|
id as id,
|
category as category,
|
userId as userId,
|
`type` as `type`,
|
orderId as orderId,
|
orderType as orderType,
|
payType as payType,
|
amount as amount,
|
code as code,
|
state as state,
|
insertTime as insertTime
|
from t_payment_record where category = #{category}
|
<if test="null != userId">
|
and userId = #{userId}
|
</if>
|
<if test="null != type">
|
and type = #{type}
|
</if>
|
<if test="null != orderId">
|
and orderId = #{orderId}
|
</if>
|
<if test="null != orderType">
|
and orderType = #{orderType}
|
</if>
|
<if test="null != payType">
|
and payType = #{payType}
|
</if>
|
<if test="null != state">
|
and state = #{state}
|
</if>
|
order by insertTime desc limit 0,1
|
</select>
|
</mapper>
|