102 lines
4.0 KiB
XML
102 lines
4.0 KiB
XML
<?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.alonginfo.project.business.mapper.YwMonthTransactionMapper">
|
|
|
|
<!--获取月度直接交易列表-->
|
|
<select id="getTransactionList" resultType="java.util.Map">
|
|
SELECT transaction_name value, transaction_name label
|
|
FROM
|
|
yw_month_transaction_notice
|
|
</select>
|
|
|
|
<!--获取交易公告-->
|
|
<select id="getTransactionNotice" resultType="java.util.Map">
|
|
SELECT transaction_type transactionType, DATE_FORMAT(organize_time, '%Y-%m-%d') organizeTime,
|
|
CONCAT(DATE_FORMAT(organize_time, '%Y-%m-%d'), ' ', DATE_FORMAT(start_time, '%H:%i:%s')) startTime,
|
|
CONCAT(DATE_FORMAT(organize_time, '%Y-%m-%d'), ' ', DATE_FORMAT(end_time, '%H:%i:%s')) endTime,
|
|
IFNULL(seller_admit, 0) sellerAdmit, IFNULL(buyer_admit, 0) buyerAdmit, transaction_cycle transactionCycle,
|
|
DATE_FORMAT(report_time, '%Y-%m-%d') reportTime
|
|
FROM
|
|
yw_month_transaction_notice
|
|
WHERE
|
|
transaction_name = #{transactionName}
|
|
</select>
|
|
|
|
<!--根据月份获取购方竞价数据-->
|
|
<select id="getBuyerData" resultType="java.util.Map">
|
|
SELECT report_number reportNumber, max_report_price maxReportPrice, min_report_price minReportPrice,
|
|
total_report_elec totalReportElec, avg_report_price avgReportPrice
|
|
FROM
|
|
yw_month_transaction_buyer_bidding_data
|
|
WHERE
|
|
month LIKE CONCAT('%', #{month}, '%')
|
|
<if test="transactionType == 300">
|
|
AND type LIKE CONCAT('%', '燃煤', '%')
|
|
</if>
|
|
<if test="transactionType == 500">
|
|
AND type LIKE CONCAT('%', '燃气', '%')
|
|
</if>
|
|
<if test="monthFlag != ''">
|
|
AND type LIKE CONCAT('%', '月内', '%')
|
|
</if>
|
|
<if test="monthFlag == ''">
|
|
AND type NOT LIKE CONCAT('%', '月内', '%')
|
|
</if>
|
|
</select>
|
|
|
|
<!--根据月份获取购方竞价明细-->
|
|
<select id="getBuyerDet" resultType="java.util.Map">
|
|
SELECT company_name companyName, report_elec reportElec, report_price reportPrice,
|
|
DATE_FORMAT(report_time, '%Y-%m-%d %H:%i:%s') reportTime
|
|
FROM
|
|
yw_month_transaction_buyer_bidding_det
|
|
<where>
|
|
month LIKE CONCAT('%', #{month}, '%')
|
|
AND
|
|
report_price >= #{transactionType}
|
|
<if test="monthFlag != ''">
|
|
AND unit_name LIKE CONCAT('%', #{monthFlag}, '%')
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<!--根据月份获取售方竞价数据-->
|
|
<select id="getSellerData" resultType="java.util.Map">
|
|
SELECT report_number reportNumber, max_report_price maxReportPrice, min_report_price minReportPrice,
|
|
total_report_elec totalReportElec, avg_report_Price avgReportPrice
|
|
FROM
|
|
yw_month_transaction_seller_bidding_data
|
|
WHERE
|
|
month LIKE CONCAT('%', #{month}, '%')
|
|
<if test="transactionType == 300">
|
|
AND type LIKE CONCAT('%', '燃煤', '%')
|
|
</if>
|
|
<if test="transactionType == 500">
|
|
AND type LIKE CONCAT('%', '燃气', '%')
|
|
</if>
|
|
<if test="monthFlag != ''">
|
|
AND type LIKE CONCAT('%', '月内', '%')
|
|
</if>
|
|
<if test="monthFlag == ''">
|
|
AND type NOT LIKE CONCAT('%', '月内', '%')
|
|
</if>
|
|
</select>
|
|
|
|
<!--根据月份获取售方竞价明细-->
|
|
<select id="getSellerDet" resultType="java.util.Map">
|
|
SELECT company_name companyName, report_elec reportElec, report_price reportPrice,
|
|
DATE_FORMAT(report_time, '%Y-%m-%d %H:%i:%s') reportTime
|
|
FROM
|
|
yw_month_transaction_seller_bidding_det
|
|
<where>
|
|
month LIKE CONCAT('%', #{month}, '%')
|
|
AND
|
|
report_price >= #{transactionType}
|
|
<if test="monthFlag != ''">
|
|
AND unit_name LIKE CONCAT('%', #{monthFlag}, '%')
|
|
</if>
|
|
</where>
|
|
</select>
|
|
</mapper> |