<?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.IncomeMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Income">
|
<id column="id" property="id"/>
|
<result column="userType" property="userType"/>
|
<result column="objectId" property="objectId"/>
|
<result column="type" property="type"/>
|
<result column="incomeId" property="incomeId"/>
|
<result column="orderType" property="orderType"/>
|
<result column="money" property="money"/>
|
<result column="insertTime" property="insertTime"/>
|
</resultMap>
|
|
|
<select id="query" resultType="map">
|
select
|
incomeId as incomeId,
|
orderType as orderType,
|
money as money,
|
DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as time
|
from t_income where 1 = 1
|
<if test="null != userType">
|
and userType = #{userType}
|
</if>
|
<if test="null != objectId">
|
and objectId = #{objectId}
|
</if>
|
<if test="null != type">
|
and `type` = #{type}
|
</if>
|
order by insertTime desc limit #{pageNum}, #{size}
|
</select>
|
|
|
|
<select id="queryData" resultType="Income">
|
select
|
id as id,
|
userType as userType,
|
objectId as objectId,
|
type as type,
|
incomeId as incomeId,
|
orderType as orderType,
|
money as money,
|
insertTime as insertTime
|
from t_income where 1 = 1
|
<if test="null != userType">
|
and userType = #{userType}
|
</if>
|
<if test="null != objectId">
|
and objectId = #{objectId}
|
</if>
|
<if test="null != type">
|
and `type` = #{type}
|
</if>
|
<if test="null != incomeId">
|
and incomeId = #{incomeId}
|
</if>
|
<if test="null != orderType">
|
and orderType = #{orderType}
|
</if>
|
</select>
|
</mapper>
|