<?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.SettlementRecordMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.SettlementRecord">
|
<id column="id" property="id"/>
|
<result column="day" property="day"/>
|
<result column="driverId" property="driverId"/>
|
<result column="type" property="type"/>
|
<result column="paymentStatus" property="paymentStatus"/>
|
<result column="payMoney" property="payMoney"/>
|
<result column="payType" property="payType"/>
|
<result column="code" property="code"/>
|
<result column="insertTime" property="insertTime"/>
|
</resultMap>
|
|
|
|
<select id="querySettlementRecordList" resultType="map">
|
select
|
a.id,
|
DATE_FORMAT(a.`day`, '%Y-%m-%d') as `day`,
|
a.payMoney,
|
a.payType,
|
a.paymentStatus,
|
CONCAT(b.firstName, ' ', b.lastName) as driverName,
|
DATE_FORMAT(a.payTime, '%Y-%m-%d %H:%i:%s') as payTime
|
from t_settlement_record a
|
left join t_driver b on (a.driverId = b.id)
|
where 1 = 1
|
<if test="null != startTime and '' != startTime and null != endTime and '' != endTime">
|
and DATE_FORMAT(a.`day`, '%Y-%m-%d') between #{startTime} and #{endTime}
|
</if>
|
<if test="null != money">
|
and a.payMoney = #{money}
|
</if>
|
<if test="null != status">
|
and a.paymentStatus = #{status}
|
</if>
|
<if test="null != driverName">
|
and CONCAT(b.firstName, ' ', b.lastName) like CONCAT('%', #{driverName}, '%')
|
</if>
|
order by a.insertTime desc
|
</select>
|
</mapper>
|