<?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.ruoyi.other.mapper.ShopBalanceStatementMapper">
|
|
<sql id="shopBalanceStatementList">
|
SELECT
|
tsbs.*,
|
ts.`name` shopName,
|
ts.shop_manager shopManagerName,
|
ts.phone
|
FROM
|
(
|
select * from t_shop_balance_statement
|
union all
|
select * from t_shop_balance_statement_copy
|
) tsbs
|
INNER JOIN t_shop ts ON ts.id = tsbs.shop_id
|
<where>
|
tsbs.type != 4 and ts.del_flag = 0
|
<if test="bs.shopName != null and bs.shopName != ''">
|
AND ts.`name` like concat('%', #{bs.shopName}, '%')
|
</if>
|
<if test="bs.shopManagerName != null and bs.shopManagerName != ''">
|
AND ts.shop_manager like concat('%', #{bs.shopManagerName}, '%')
|
</if>
|
<if test="bs.phone != null and bs.phone != ''">
|
AND ts.phone like concat('%', #{bs.phone}, '%')
|
</if>
|
<if test="bs.type != null">
|
AND tsbs.type = #{bs.type}
|
</if>
|
<if test="bs.startTime != null and bs.endTime != null">
|
AND tsbs.create_time BETWEEN #{bs.startTime} AND #{bs.endTime}
|
</if>
|
</where>
|
order by tsbs.create_time desc
|
</sql>
|
|
<select id="queryShopBalanceStatementPage" resultType="com.ruoyi.other.api.domain.ShopBalanceStatement">
|
<include refid="shopBalanceStatementList"/>
|
</select>
|
<select id="selectShopBalanceStatementList" resultType="com.ruoyi.other.api.domain.ShopBalanceStatement">
|
<include refid="shopBalanceStatementList"/>
|
</select>
|
|
|
<select id="shopCommissionStatisticslist" resultType="com.ruoyi.other.api.domain.ShopBalanceStatement">
|
select * from (
|
select * from t_shop_balance_statement where shop_id = #{shopId}
|
union all
|
select * from t_shop_balance_statement_copy where shop_id = #{shopId}
|
) as aa
|
<where>
|
<if test="null != type">
|
and aa.type = #{type}
|
</if>
|
</where>
|
order by aa.create_time desc
|
</select>
|
</mapper>
|