38 lines
1.7 KiB
XML
38 lines
1.7 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.gansu.mapper.BuySaleDetailDao">
|
||
|
|
||
|
<!-- 购售方明细数据入库 -->
|
||
|
<insert id="pushBuySaleDetail" parameterType="java.util.List">
|
||
|
INSERT INTO
|
||
|
task_buy_sale_detail
|
||
|
(detail_id, trade_seq_id, trade_time_part, trade_time_range, sale_units_names,
|
||
|
vendee_units_names, sale_participant_name, vendee_participant_name, confirm_energy,
|
||
|
confirm_time, data_time)
|
||
|
VALUES
|
||
|
<foreach collection="list" item="item" separator=",">
|
||
|
(NULL, #{item.tradeSeqId}, #{item.tradeTimePart}, #{item.tradeTimeRange},
|
||
|
#{item.saleUnitsNames}, #{item.vendeeUnitsNames}, #{item.saleParticipantName},
|
||
|
#{item.vendeeParticipantName}, #{item.confirmEnergy}, #{item.confirmTime}, #{item.dataTime})
|
||
|
</foreach>
|
||
|
</insert>
|
||
|
|
||
|
<!-- 通过交易序列id获取购售方明细数据 - 表格数据 -->
|
||
|
<select id = "getDetailBySeqId" parameterType="java.lang.String" resultType="java.util.Map">
|
||
|
SELECT sale_participant_name saleParticipantName, vendee_participant_name vendeeParticipantName, trade_time_range tradeTimeRange,
|
||
|
ROUND(confirm_energy, 2) confirmEnergy, DATE_FORMAT(confirm_time, '%Y-%m-%d %H:%i:%s') confirmTime
|
||
|
FROM
|
||
|
task_buy_sale_detail
|
||
|
WHERE
|
||
|
trade_seq_id = #{seqId}
|
||
|
ORDER BY
|
||
|
confirmTime
|
||
|
DESC
|
||
|
</select>
|
||
|
|
||
|
<!-- 删除旧购售方明细数据 - 表格数据 -->
|
||
|
<delete id="delDeclareDetail">
|
||
|
DELETE FROM
|
||
|
task_buy_sale_detail
|
||
|
</delete>
|
||
|
</mapper>
|