|
@@ -1599,4 +1599,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="selectOrderByCustomerIds" resultType="com.fs.statis.domain.Report">
|
|
|
|
+ SELECT
|
|
|
|
+ order_code AS orderSn,
|
|
|
|
+ real_name AS userName,
|
|
|
|
+ pay_price AS money,
|
|
|
|
+ pay_time AS payTime,
|
|
|
|
+ status AS orderStatus,
|
|
|
|
+ customer_id AS customerId
|
|
|
|
+ FROM
|
|
|
|
+ fs_store_order
|
|
|
|
+ WHERE
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="map.orderStatus != null and map.orderStatus != ''">
|
|
|
|
+ status = #{map.orderStatus}
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ status >= 2
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ <if test="map.companyId != null and map.companyId!=''">
|
|
|
|
+ AND company_id = #{map.companyId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="map.customerIds!=null and map.customerIds.size() > 0">
|
|
|
|
+ AND customer_id IN
|
|
|
|
+ <foreach collection="map.customerIds" item="id" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="map.payTime!=null">
|
|
|
|
+ AND pay_time >= STR_TO_DATE(#{map.payTime}, '%Y-%m-%d')
|
|
|
|
+ AND pay_time < DATE_ADD(STR_TO_DATE(#{map.payTime}, '%Y-%m-%d'), INTERVAL 1 DAY)
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|