|
|
@@ -99,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="status != null">status,</if>
|
|
|
<if test="avatar !=null">avatar,</if>
|
|
|
<if test="bidNo !=null">bid_no,</if>
|
|
|
+ <if test="userCode !=null">user_code,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">#{id},</if>
|
|
|
@@ -120,15 +121,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="status != null">#{status},</if>
|
|
|
<if test="avatar !=null">#{avatar},</if>
|
|
|
<if test="bidNo !=null">#{bidNo},</if>
|
|
|
+ <if test="userCode !=null">#{userCode},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<insert id="batchInsertBid" useGeneratedKeys="true" keyProperty="id">
|
|
|
- INSERT INTO bid (lot_id,round,account,account_id,amount,device_type,ip,del_flag,create_by,create_time,update_by,update_time,remark,anonymous,curr,status,avatar,bid_no)
|
|
|
+ INSERT INTO bid (lot_id,round,account,account_id,amount,device_type,ip,del_flag,create_by,create_time,update_by,update_time,remark,anonymous,curr,status,avatar,bid_no,user_code)
|
|
|
values
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
(
|
|
|
#{item.lotId},#{item.round},#{item.account},#{item.accountId},#{item.amount},#{item.deviceType},#{item.ip},#{item.delFlag},#{item.createBy},
|
|
|
- #{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.anonymous},#{item.curr},#{item.status},#{item.avatar},#{item.bidNo}
|
|
|
+ #{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.anonymous},#{item.curr},#{item.status},#{item.avatar},#{item.bidNo},#{item.userCode}
|
|
|
)
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
@@ -190,6 +192,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and lot_id = #{lotId}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectUserCodeByAuctionAndAccount" resultType="String">
|
|
|
+ select b.user_code
|
|
|
+ from bid b
|
|
|
+ inner join lot l on l.id = b.lot_id
|
|
|
+ where l.auction_id = #{auctionId}
|
|
|
+ and b.account_id = #{accountId}
|
|
|
+ and b.user_code is not null
|
|
|
+ and b.user_code != ''
|
|
|
+ order by b.create_time asc
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMaxUserCodeByAuction" resultType="Long">
|
|
|
+ select max(cast(b.user_code as bigint))
|
|
|
+ from bid b
|
|
|
+ inner join lot l on l.id = b.lot_id
|
|
|
+ where l.auction_id = #{auctionId}
|
|
|
+ and b.user_code ~ '^[0-9]+$'
|
|
|
+ </select>
|
|
|
+
|
|
|
<delete id="deleteBidById" parameterType="Long">
|
|
|
delete from bid where id = #{id}
|
|
|
</delete>
|