|
@@ -1134,4 +1134,469 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where user_id = #{fsUserId} and create_time >= DATE_SUB(NOW(), INTERVAL 30 DAY)
|
|
|
order by create_time desc limit 3
|
|
|
</select>
|
|
|
+ <select id="selectFsStoreOrderListVOByErpAccountByExportCount" resultType="java.lang.Long">
|
|
|
+ select count(1)
|
|
|
+ from fs_store_order so
|
|
|
+ LEFT JOIN fs_store st ON so.store_id =st.store_id
|
|
|
+ left join fs_user u on so.user_id=u.user_id
|
|
|
+ LEFT JOIN fs_prescribe p ON p.prescribe_id =so.prescribe_id
|
|
|
+ LEFT JOIN fs_doctor d ON p.doctor_id= d.doctor_id
|
|
|
+ left join company c on c.company_id=so.company_id
|
|
|
+ left join company_user cu on cu.user_id=so.company_user_id
|
|
|
+ left join company_tcm_schedule cts on cts.id = so.schedule_id
|
|
|
+ left join fs_patient pat on pat.patient_id = p.patient_id
|
|
|
+ LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
|
|
|
+ WHERE so.is_del=0
|
|
|
+ <if test="maps.packageSecondName != null and maps.packageSecondName != '' ">
|
|
|
+ and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.storeId != null ">
|
|
|
+ and so.store_id = #{maps.storeId}
|
|
|
+ </if>
|
|
|
+ <if test="maps.source != null ">
|
|
|
+ and so.source = #{maps.source}
|
|
|
+ </if>
|
|
|
+ <if test="maps.orderCodes != null and maps.orderCodes.size > 0">
|
|
|
+ and so.order_code in
|
|
|
+ <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
|
|
|
+ #{orderCode}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="maps.orderCode != null and maps.orderCode != ''">
|
|
|
+ and so.order_code = #{maps.orderCode}
|
|
|
+ </if>
|
|
|
+ <if test="maps.prescribeCode != null and maps.prescribeCode != ''">
|
|
|
+ and p.prescribe_code = #{maps.prescribeCode}
|
|
|
+ </if>
|
|
|
+ <if test="maps.userName != null and maps.userName != ''">
|
|
|
+ and so.user_name like concat('%', #{maps.userName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.userPhone != null and maps.userPhone != ''">
|
|
|
+ and so.user_phone = #{maps.userPhone}
|
|
|
+ </if>
|
|
|
+ <if test="maps.totalNum != null and maps.totalNum != ''">
|
|
|
+ and so.total_num = #{maps.totalNum}
|
|
|
+ </if>
|
|
|
+ <if test="maps.totalPrice != null">
|
|
|
+ and so.total_price = #{maps.totalPrice}
|
|
|
+ </if>
|
|
|
+ <if test="maps.status != null and maps.status != 6">
|
|
|
+ and so.status = #{maps.status}
|
|
|
+ </if>
|
|
|
+ <if test="maps.status == 6">
|
|
|
+ and so.`status`= 2
|
|
|
+ and ( so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1))
|
|
|
+ and (so.extend_order_id is null or so.extend_order_id like '')
|
|
|
+ </if>
|
|
|
+ <if test="maps.refundStatus != null and maps.refundStatus != ''">
|
|
|
+ and so.refund_status = #{maps.refundStatus}
|
|
|
+ </if>
|
|
|
+ <if test="maps.refundExplain != null and maps.refundExplain != ''">
|
|
|
+ and so.refund_explain = #{maps.refundExplain}
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliverySn != null and maps.deliverySn != ''">
|
|
|
+ and so.delivery_sn = #{maps.deliverySn}
|
|
|
+ </if>
|
|
|
+ <if test="maps.shippingType != null">
|
|
|
+ and so.shipping_type = #{maps.shippingType}
|
|
|
+ </if>
|
|
|
+ <if test="maps.isChannel != null and maps.isChannel != ''">
|
|
|
+ and so.is_channel = #{maps.isChannel}
|
|
|
+ </if>
|
|
|
+ <if test="maps.isPrescribe != null">
|
|
|
+ and so.is_prescribe = #{maps.isPrescribe}
|
|
|
+ </if>
|
|
|
+ <if test="maps.prescribeId != null">
|
|
|
+ and so.prescribe_id = #{maps.prescribeId}
|
|
|
+ </if>
|
|
|
+ <if test="maps.companyUserId != null">
|
|
|
+ and so.company_user_id = #{maps.companyUserId}
|
|
|
+ </if>
|
|
|
+ <if test="maps.sTime != null">
|
|
|
+ and DATE(so.create_time) >= DATE(#{maps.sTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.eTime != null">
|
|
|
+ and DATE(so.create_time) <= DATE(#{maps.eTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.paysTime != null">
|
|
|
+ and DATE(so.pay_time) >= DATE(#{maps.paysTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.payeTime != null">
|
|
|
+ and DATE(so.pay_time) <= DATE(#{maps.payeTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.orderCreateType != null">
|
|
|
+ and so.order_create_type = #{maps.orderCreateType}
|
|
|
+ </if>
|
|
|
+ <if test="maps.patientName != null">
|
|
|
+ and p.patient_name like concat('%', #{maps.patientName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.doctorName != null">
|
|
|
+ and d.doctor_name like concat('%', #{maps.doctorName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.orderType != null">
|
|
|
+ and so.order_type = #{maps.orderType}
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliverySendsTime != null ">
|
|
|
+ and DATE(so.delivery_send_time) >= DATE(#{maps.deliverySendsTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliverySendeTime != null">
|
|
|
+ and DATE(so.delivery_send_time) <= DATE(#{maps.deliverySendeTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliveryImportsTime != null">
|
|
|
+ and DATE(so.delivery_import_time) >= DATE(#{maps.deliveryImportsTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliveryImporteTime != null">
|
|
|
+ and DATE(so.delivery_import_time) <= DATE(#{maps.deliveryImporteTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.tuisTime != null ">
|
|
|
+ and DATE(so.tui_money_time) >= DATE(#{maps.tuisTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.tuieTime != null">
|
|
|
+ and DATE(so.tui_money_time) <= DATE(#{maps.tuieTime})
|
|
|
+ </if>
|
|
|
+ <if test = "maps.companyUserNickName != null and maps.companyUserNickName != '' ">
|
|
|
+ and cu.nick_name like concat( #{maps.companyUserNickName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.companyIds != null and maps.companyIds.size >0">
|
|
|
+ and so.company_id in
|
|
|
+ <foreach collection="maps.companyIds" item="companyId" open="(" close=")" separator=",">
|
|
|
+ #{companyId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test = "maps.companyId != null and maps.companyId != '-1' ">
|
|
|
+ and so.company_id =#{maps.companyId}
|
|
|
+ </if>
|
|
|
+ <if test="maps.userId != null ">
|
|
|
+ and so.user_id = #{maps.userId}</if>
|
|
|
+ <if test = "maps.companyId == '-1' ">
|
|
|
+ and so.company_id is null
|
|
|
+ </if>
|
|
|
+ <if test = "maps.deliveryStatus != null">
|
|
|
+ and so.delivery_status =#{maps.deliveryStatus}
|
|
|
+ </if>
|
|
|
+ <if test = "maps.deliveryPayStatus != null">
|
|
|
+ and so.delivery_pay_status =#{maps.deliveryPayStatus}
|
|
|
+ </if>
|
|
|
+ <if test = "maps.tuiMoneyStatus != null">
|
|
|
+ and so.tui_money_status =#{maps.tuiMoneyStatus}
|
|
|
+ </if>
|
|
|
+ <if test = "maps.deptId != null">
|
|
|
+ AND (so.dept_id = #{maps.deptId} OR so.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
|
|
|
+ </if>
|
|
|
+ <if test="maps.packageName != null and maps.packageName != '' ">
|
|
|
+ and so.package_name like concat('%', #{maps.packageName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test = "maps.payType != null">
|
|
|
+ and so.pay_type IN
|
|
|
+ <foreach collection="maps.payType.split(',')" item='item' index='index' open='(' separator=',' close=')'>
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test = "maps.scheduleId != null and maps.scheduleId != '-1' " >
|
|
|
+ and so.schedule_id IN
|
|
|
+ <foreach collection="maps.scheduleId.split(',')" item='item' index='index' open='(' separator=',' close=')'>
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test = "maps.scheduleId == '-1' " >
|
|
|
+ and so.schedule_id is null
|
|
|
+ </if>
|
|
|
+ <if test = "maps.orderBuyType != null and maps.orderBuyType != '-1'">
|
|
|
+ and so.order_buy_type IN
|
|
|
+ <foreach collection="maps.orderBuyType.split(',')" item='item' index='index' open='(' separator=',' close=')'>
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test = "maps.orderBuyType == '-1' " >
|
|
|
+ and so.order_buy_type is null
|
|
|
+ </if>
|
|
|
+ <if test = "maps.orderChannel != null and maps.orderChannel != '-1' " >
|
|
|
+ and so.order_channel IN
|
|
|
+ <foreach collection="maps.orderChannel.split(',')" item='item' index='index' open='(' separator=',' close=')'>
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test = "maps.orderChannel == '-1'">
|
|
|
+ and so.order_channel is null
|
|
|
+ </if>
|
|
|
+ <if test = "maps.qwSubject != null and maps.qwSubject != '-1'">
|
|
|
+ and so.qw_subject IN
|
|
|
+ <foreach collection="maps.qwSubject.split(',')" item='item' index='index' open='(' separator=',' close=')'>
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test ="maps.qwSubject == '-1' ">
|
|
|
+ and so.qw_subject is null
|
|
|
+ </if>
|
|
|
+ <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
|
|
|
+ and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''">
|
|
|
+ and df.login_account like #{maps.erpAccount}
|
|
|
+ </if>
|
|
|
+ <if test="maps.erpAccount == '未分拣'">
|
|
|
+ and ( df.login_account is null or df.login_account like '')
|
|
|
+ </if>
|
|
|
+ ${maps.params.dataScope}
|
|
|
+ </select>
|
|
|
+ <select id="selectFsStoreOrderListErpVOByExport" resultType="com.fs.his.vo.FsStoreOrderErpExportVO">
|
|
|
+ SELECT
|
|
|
+ so.*,
|
|
|
+ u.nick_name,
|
|
|
+ u.phone,
|
|
|
+ p.patient_name,
|
|
|
+ TIMESTAMPDIFF(YEAR, pat.birthday, CURDATE()) AS age,
|
|
|
+ pat.sex,
|
|
|
+ p.prescribe_code,
|
|
|
+ d.doctor_name,
|
|
|
+ pat.relation,
|
|
|
+ CONCAT(u.nick_name, '(', LEFT(u.phone, 3), '****', RIGHT(u.phone, 4), ')') AS `user`,
|
|
|
+ c.company_name,
|
|
|
+ cu.nick_name AS company_user_nick_name,
|
|
|
+ cts.name AS schedule_name,
|
|
|
+ st.store_name,df.login_account as erp_account
|
|
|
+ FROM fs_store_order so
|
|
|
+ LEFT JOIN fs_store st ON so.store_id = st.store_id
|
|
|
+ LEFT JOIN fs_user u ON so.user_id = u.user_id
|
|
|
+ LEFT JOIN fs_prescribe p ON p.prescribe_id = so.prescribe_id
|
|
|
+ LEFT JOIN fs_doctor d ON p.doctor_id = d.doctor_id
|
|
|
+ LEFT JOIN company c ON c.company_id = so.company_id
|
|
|
+ LEFT JOIN company_user cu ON cu.user_id = so.company_user_id
|
|
|
+ LEFT JOIN company_tcm_schedule cts ON cts.id = so.schedule_id
|
|
|
+ LEFT JOIN fs_patient pat ON pat.patient_id = p.patient_id
|
|
|
+ LEFT JOIN fs_store_order_df df on df.order_id=so.order_id
|
|
|
+ WHERE so.is_del = 0
|
|
|
+
|
|
|
+ <!-- 动态条件 -->
|
|
|
+ <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
|
|
|
+ AND so.package_second_name LIKE CONCAT('%', #{maps.packageSecondName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.storeId != null">
|
|
|
+ AND so.store_id = #{maps.storeId}
|
|
|
+ </if>
|
|
|
+ <if test="maps.source != null">
|
|
|
+ AND so.source = #{maps.source}
|
|
|
+ </if>
|
|
|
+ <if test="maps.orderCodes != null and maps.orderCodes.size > 0">
|
|
|
+ and so.order_code in
|
|
|
+ <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
|
|
|
+ #{orderCode}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="maps.orderCode != null and maps.orderCode != ''">
|
|
|
+ AND so.order_code = #{maps.orderCode}
|
|
|
+ </if>
|
|
|
+ <if test="maps.prescribeCode != null and maps.prescribeCode != ''">
|
|
|
+ AND p.prescribe_code = #{maps.prescribeCode}
|
|
|
+ </if>
|
|
|
+ <if test="maps.userName != null and maps.userName != ''">
|
|
|
+ AND so.user_name LIKE CONCAT('%', #{maps.userName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.userPhone != null and maps.userPhone != ''">
|
|
|
+ AND so.user_phone = #{maps.userPhone}
|
|
|
+ </if>
|
|
|
+ <if test="maps.totalNum != null and maps.totalNum != ''">
|
|
|
+ AND so.total_num = #{maps.totalNum}
|
|
|
+ </if>
|
|
|
+ <if test="maps.totalPrice != null">
|
|
|
+ AND so.total_price = #{maps.totalPrice}
|
|
|
+ </if>
|
|
|
+ <if test="maps.status != null and maps.status != 6">
|
|
|
+ AND so.status = #{maps.status}
|
|
|
+ </if>
|
|
|
+ <if test="maps.status == 6">
|
|
|
+ AND so.`status` = 2
|
|
|
+ AND (
|
|
|
+ so.store_id IN (SELECT store_id FROM fs_store WHERE delivery_type=2 OR delivery_type=1)
|
|
|
+ )
|
|
|
+ AND (so.extend_order_id IS NULL OR so.extend_order_id = '')
|
|
|
+ </if>
|
|
|
+ <if test="maps.refundStatus != null and maps.refundStatus != ''">
|
|
|
+ AND so.refund_status = #{maps.refundStatus}
|
|
|
+ </if>
|
|
|
+ <if test="maps.refundExplain != null and maps.refundExplain != ''">
|
|
|
+ AND so.refund_explain = #{maps.refundExplain}
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliverySn != null and maps.deliverySn != ''">
|
|
|
+ AND so.delivery_sn = #{maps.deliverySn}
|
|
|
+ </if>
|
|
|
+ <if test="maps.shippingType != null">
|
|
|
+ AND so.shipping_type = #{maps.shippingType}
|
|
|
+ </if>
|
|
|
+ <if test="maps.isChannel != null and maps.isChannel != ''">
|
|
|
+ AND so.is_channel = #{maps.isChannel}
|
|
|
+ </if>
|
|
|
+ <if test="maps.isPrescribe != null">
|
|
|
+ AND so.is_prescribe = #{maps.isPrescribe}
|
|
|
+ </if>
|
|
|
+ <if test="maps.prescribeId != null">
|
|
|
+ AND so.prescribe_id = #{maps.prescribeId}
|
|
|
+ </if>
|
|
|
+ <if test="maps.companyUserId != null">
|
|
|
+ AND so.company_user_id = #{maps.companyUserId}
|
|
|
+ </if>
|
|
|
+ <if test="maps.sTime != null">
|
|
|
+ AND DATE(so.create_time) >= DATE(#{maps.sTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.eTime != null">
|
|
|
+ AND DATE(so.create_time) <= DATE(#{maps.eTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.paysTime != null">
|
|
|
+ AND DATE(so.pay_time) >= DATE(#{maps.paysTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.payeTime != null">
|
|
|
+ AND DATE(so.pay_time) <= DATE(#{maps.payeTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.orderCreateType != null">
|
|
|
+ AND so.order_create_type = #{maps.orderCreateType}
|
|
|
+ </if>
|
|
|
+ <if test="maps.patientName != null">
|
|
|
+ AND p.patient_name LIKE CONCAT('%', #{maps.patientName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.doctorName != null">
|
|
|
+ AND d.doctor_name LIKE CONCAT('%', #{maps.doctorName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.orderType != null">
|
|
|
+ AND so.order_type = #{maps.orderType}
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliverySendsTime != null">
|
|
|
+ AND DATE(so.delivery_send_time) >= DATE(#{maps.deliverySendsTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliverySendeTime != null">
|
|
|
+ AND DATE(so.delivery_send_time) <= DATE(#{maps.deliverySendeTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliveryImportsTime != null">
|
|
|
+ AND DATE(so.delivery_import_time) >= DATE(#{maps.deliveryImportsTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliveryImporteTime != null">
|
|
|
+ AND DATE(so.delivery_import_time) <= DATE(#{maps.deliveryImporteTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.tuisTime != null">
|
|
|
+ AND DATE(so.tui_money_time) >= DATE(#{maps.tuisTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.tuieTime != null">
|
|
|
+ AND DATE(so.tui_money_time) <= DATE(#{maps.tuieTime})
|
|
|
+ </if>
|
|
|
+ <if test="maps.companyUserNickName != null and maps.companyUserNickName != ''">
|
|
|
+ AND cu.nick_name LIKE CONCAT(#{maps.companyUserNickName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.userId != null">
|
|
|
+ AND so.user_id = #{maps.userId}
|
|
|
+ </if>
|
|
|
+ <if test="maps.companyIds != null and maps.companyIds.size >0">
|
|
|
+ and so.company_id in
|
|
|
+ <foreach collection="maps.companyIds" item="companyId" open="(" close=")" separator=",">
|
|
|
+ #{companyId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <choose>
|
|
|
+ <when test="maps.companyId != null and maps.companyId == '-1'">
|
|
|
+ AND so.company_id IS NULL
|
|
|
+ </when>
|
|
|
+ <when test="maps.companyId != null">
|
|
|
+ AND so.company_id = #{maps.companyId}
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ <if test="maps.deliveryStatus != null">
|
|
|
+ AND so.delivery_status = #{maps.deliveryStatus}
|
|
|
+ </if>
|
|
|
+ <if test="maps.deliveryPayStatus != null">
|
|
|
+ AND so.delivery_pay_status = #{maps.deliveryPayStatus}
|
|
|
+ </if>
|
|
|
+ <if test="maps.tuiMoneyStatus != null">
|
|
|
+ AND so.tui_money_status = #{maps.tuiMoneyStatus}
|
|
|
+ </if>
|
|
|
+ <if test="maps.deptId != null">
|
|
|
+ AND (so.dept_id = #{maps.deptId} OR so.dept_id IN (
|
|
|
+ SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors)
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="maps.packageName != null and maps.packageName != ''">
|
|
|
+ AND so.package_name LIKE CONCAT('%', #{maps.packageName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.payType != null">
|
|
|
+ AND so.pay_type IN
|
|
|
+ <foreach collection="maps.payType.split(',')" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <choose>
|
|
|
+ <when test="maps.scheduleId != null and maps.scheduleId == '-1'">
|
|
|
+ AND so.schedule_id IS NULL
|
|
|
+ </when>
|
|
|
+ <when test="maps.scheduleId != null">
|
|
|
+ AND so.schedule_id IN
|
|
|
+ <foreach collection="maps.scheduleId.split(',')" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ <choose>
|
|
|
+ <when test="maps.orderBuyType != null and maps.orderBuyType == '-1'">
|
|
|
+ AND so.order_buy_type IS NULL
|
|
|
+ </when>
|
|
|
+ <when test="maps.orderBuyType != null">
|
|
|
+ AND so.order_buy_type IN
|
|
|
+ <foreach collection="maps.orderBuyType.split(',')" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ <choose>
|
|
|
+ <when test="maps.orderChannel != null and maps.orderChannel == '-1'">
|
|
|
+ AND so.order_channel IS NULL
|
|
|
+ </when>
|
|
|
+ <when test="maps.orderChannel != null">
|
|
|
+ AND so.order_channel IN
|
|
|
+ <foreach collection="maps.orderChannel.split(',')" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ <choose>
|
|
|
+ <when test="maps.qwSubject != null and maps.qwSubject == '-1'">
|
|
|
+ AND so.qw_subject IS NULL
|
|
|
+ </when>
|
|
|
+ <when test="maps.qwSubject != null">
|
|
|
+ AND so.qw_subject IN
|
|
|
+ <foreach collection="maps.qwSubject.split(',')" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
|
|
|
+ and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')
|
|
|
+ </if>
|
|
|
+ <if test="maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''">
|
|
|
+ and df.login_account like #{maps.erpAccount}
|
|
|
+ </if>
|
|
|
+ <if test="maps.erpAccount == '未分拣'">
|
|
|
+ and ( df.login_account is null or df.login_account like '')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ ${maps.params.dataScope}
|
|
|
+ ORDER BY
|
|
|
+
|
|
|
+ <if test="maps.sortField == 'companyUserName'">
|
|
|
+ cu.nick_name
|
|
|
+ </if>
|
|
|
+ <if test="maps.sortField == 'packageName'">
|
|
|
+ so.package_name
|
|
|
+ </if>
|
|
|
+ <if test="maps.sortField == 'payPrice'">
|
|
|
+ so.pay_price
|
|
|
+ </if>
|
|
|
+ <if test="maps.sortField == 'payMoney'">
|
|
|
+ so.pay_money
|
|
|
+ </if>
|
|
|
+ <if test="maps.sortOrder != null and maps.sortOrder != ''">
|
|
|
+ ${maps.sortOrder}
|
|
|
+ </if>
|
|
|
+ <if test="maps.sortField == null or maps.sortField == ''">
|
|
|
+ so.order_id desc
|
|
|
+ </if>
|
|
|
+ LIMIT 30000
|
|
|
+
|
|
|
+
|
|
|
+ </select>
|
|
|
</mapper>
|