| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xcong.excoin.modules.contract.dao.ContractHoldOrderDao"> |
| | | |
| | | <select id="selectHoldOrderListByMemberIdAndSymbolTest" resultType="com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity"> |
| | | select * from contract_hold_order where member_id=#{memberId} |
| | | <if test="type!=null and type!=0"> |
| | | and contract_type=#{type} |
| | | </if> |
| | | and is_can_closing=1 |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <update id="updateContractHoldOrderCanNotClosingByIds" parameterType="map"> |
| | | UPDATE contract_hold_order set is_can_closing = 0,batch_no=#{batchNo} |
| | | where is_can_closing=1 |
| | |
| | | |
| | | <select id="selectHoldOrderListForWholeByMemberIdAndSymbol" resultType="com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity"> |
| | | select * from contract_hold_order where member_id=#{memberId} |
| | | and symbol=#{symbol} |
| | | <if test="symbol != null and symbol != ''"> |
| | | and symbol=#{symbol} |
| | | </if> |
| | | and position_type=2 |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="selectAllWholeOrderMemberId" resultType="java.lang.Long"> |
| | | select |
| | | member_id |
| | | from contract_hold_order |
| | | where position_type=2 and is_can_closing=1 |
| | | group by member_id |
| | | </select> |
| | | |
| | | <select id="selectWholeHoldOrderSymbolsByMemberId" resultType="java.lang.String"> |
| | | select distinct symbol |
| | | from contract_hold_order |
| | | where position_type=2 and member_id=#{memberId} |
| | | </select> |
| | | |
| | | <update id="updateForcePriceBySymbolAndMemberId"> |
| | | update contract_hold_order |
| | | set force_closing_price=#{forcePrice}, is_can_closing=1 |
| | | where member_id=#{memberId} and symbol=#{symbol} |
| | | </update> |
| | | |
| | | |
| | | <update id="updateMemberAllHoldOrderClosingStatus"> |
| | | update contract_hold_order |
| | | set is_can_closing = 0 |
| | | where member_id=#{memberId} |
| | | </update> |
| | | |
| | | <select id="selectMemberHasWholeOrder" resultType="java.lang.Long"> |
| | | select distinct member_id |
| | | from contract_hold_order |
| | | where position_type=2 |
| | | </select> |
| | | |
| | | </mapper> |