|
|
@@ -28,7 +28,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="dealAccountId" column="deal_account_id" />
|
|
|
<result property="dealAccount" column="deal_account" />
|
|
|
<result property="paid" column="paid" />
|
|
|
- <result property="orderId" column="order_id" />
|
|
|
<result property="bidCount" column="bid_count" />
|
|
|
<result property="bidPersionCount" column="bid_persion_count" />
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
@@ -48,11 +47,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="groupId" column="group_id"/>
|
|
|
<result property="deposit" column="deposit"/>
|
|
|
<result property="serviceTariff" column="service_tariff"/>
|
|
|
+ <result property="payTimeLimit" column="pay_time_limit"/>
|
|
|
+ <result property="category" column="category"/>
|
|
|
+ <result property="subCategory" column="sub_category"/>
|
|
|
+ <result property="properties" column="properties" jdbcType="OTHER" typeHandler="cn.hobbystocks.auc.mapper.handler.JsonNodeTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectLotVo">
|
|
|
- select id, goods_id, auction_id, name, num, unit, imgs, detail, pub_status, pub_time, status, start_time, end_time, real_end_time, rule_type, rule_content, last_price, last_price_time, deal_price, deal_time, deal_account_id, deal_account, paid, order_id, bid_count, bid_persion_count, del_flag, create_by, create_time, update_by, update_time, sort,
|
|
|
- carousel_imgs,merchant_id,merchant_name,merchant_avatar,goods_name,goods_type,private_domain,delay_publish,pub_status,group_id,deposit,service_tariff
|
|
|
+ select id, goods_id, auction_id, name, num, unit, imgs, detail, pub_status, pub_time, status, start_time, end_time, real_end_time, rule_type, rule_content, last_price, last_price_time, deal_price, deal_time, deal_account_id, deal_account, paid, bid_count, bid_persion_count, del_flag, create_by, create_time, update_by, update_time, sort,
|
|
|
+ carousel_imgs,merchant_id,merchant_name,merchant_avatar,goods_name,goods_type,private_domain,delay_publish,pub_status,group_id,deposit,service_tariff,pay_time_limit,category,sub_category,properties
|
|
|
from lot
|
|
|
</sql>
|
|
|
|
|
|
@@ -60,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
select l.id, l.goods_id, l.auction_id, l.name, l.num, l.unit, l.imgs, l.detail,
|
|
|
l.pub_status, l.pub_time, l.status, l.start_time, l.end_time, l.real_end_time, l.rule_type,
|
|
|
l.rule_content, l.last_price, l.last_price_time, l.deal_price, l.deal_time, l.deal_account_id,
|
|
|
- l.deal_account, l.paid, l.order_id, l.bid_count, l.bid_persion_count, l.del_flag, l.create_by,
|
|
|
+ l.deal_account, l.paid, l.bid_count, l.bid_persion_count, l.del_flag, l.create_by,
|
|
|
l.create_time, l.update_by, l.update_time, l.sort,l.carousel_imgs,l.merchant_id,l.merchant_name,
|
|
|
l.merchant_avatar,l.goods_name,l.goods_type,l.private_domain,l.group_id,l.live_id
|
|
|
from
|
|
|
@@ -72,9 +75,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<where>
|
|
|
<if test="lot.name != null and lot.name != ''"> and name like concat('%', #{lot.name}, '%')</if>
|
|
|
<if test="lot.pubStatus != null "> and pub_status = #{lot.pubStatus}</if>
|
|
|
- and auction_id = #{lot.auctionId}
|
|
|
+ <if test="lot.auctionId!=null">and auction_id=#{lot.auctionId}</if>
|
|
|
</where>
|
|
|
- order by sort asc,id desc
|
|
|
+ order by sort desc,id desc
|
|
|
</select>
|
|
|
<select id="selectLotByGroupIds" parameterType="Long" resultMap="LotResult">
|
|
|
<include refid="selectLotVo"/>
|
|
|
@@ -122,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="dealAccountId != null">deal_account_id,</if>
|
|
|
<if test="dealAccount != null">deal_account,</if>
|
|
|
<if test="paid != null">paid,</if>
|
|
|
- <if test="orderId != null">order_id,</if>
|
|
|
+
|
|
|
<if test="bidCount != null">bid_count,</if>
|
|
|
<if test="bidPersionCount != null">bid_persion_count,</if>
|
|
|
<if test="delFlag != null">del_flag,</if>
|
|
|
@@ -142,6 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="groupId != null ">group_id,</if>
|
|
|
<if test="deposit !=null ">deposit,</if>
|
|
|
<if test="serviceTariff !=null ">service_tariff,</if>
|
|
|
+ <if test="payTimeLimit!=null">pay_limit_time,</if>
|
|
|
+ <if test="category!=null and category!=''">category,</if>
|
|
|
+ <if test="subCategory!=null and subCategory!=''">sub_category,</if>
|
|
|
+ <if test="properties!=null">properties,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">#{id},</if>
|
|
|
@@ -167,7 +174,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="dealAccountId != null">#{dealAccountId},</if>
|
|
|
<if test="dealAccount != null">#{dealAccount},</if>
|
|
|
<if test="paid != null">#{paid},</if>
|
|
|
- <if test="orderId != null">#{orderId},</if>
|
|
|
<if test="bidCount != null">#{bidCount},</if>
|
|
|
<if test="bidPersionCount != null">#{bidPersionCount},</if>
|
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
|
@@ -187,6 +193,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="groupId != null ">#{groupId},</if>
|
|
|
<if test="deposit !=null ">#{deposit},</if>
|
|
|
<if test="serviceTariff !=null ">#{serviceTariff},</if>
|
|
|
+ <if test="payTimeLimit!=null">#{payTimeLimit},</if>
|
|
|
+ <if test="category!=null and category!=''">#{category},</if>
|
|
|
+ <if test="subCategory!=null and subCategory!=''">#{subCategory}</if>
|
|
|
+ <if test="properties!=null">#{properties,jdbcType=OTHER,typeHandler=cn.hobbystocks.auc.mapper.handler.JsonNodeTypeHandler}</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -221,6 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="groupId != null ">group_id,</if>
|
|
|
<if test="deposit !=null ">deposit,</if>
|
|
|
<if test="serviceTariff !=null ">service_tariff,</if>
|
|
|
+ <if test="payTimeLimit!=null">pay_time_limit,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="goodsId != null">#{goodsId},</if>
|
|
|
@@ -251,12 +262,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="groupId != null ">#{groupId},</if>
|
|
|
<if test="deposit !=null ">#{deposit},</if>
|
|
|
<if test="serviceTariff !=null ">#{serviceTariff},</if>
|
|
|
+ <if test="payTimeLimit!=null">#{payTimeLimit},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
- <update id="updateOrder">
|
|
|
- update lot set order_id = #{orderId} where id = #{lotId} and order_id is NULL
|
|
|
- </update>
|
|
|
+
|
|
|
|
|
|
<update id="updateLot" parameterType="cn.hobbystocks.auc.domain.Lot">
|
|
|
update lot
|
|
|
@@ -283,7 +293,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="dealAccountId != null">deal_account_id = #{dealAccountId},</if>
|
|
|
<if test="dealAccount != null">deal_account = #{dealAccount},</if>
|
|
|
<if test="paid != null">paid = #{paid},</if>
|
|
|
- <if test="orderId != null">order_id = #{orderId},</if>
|
|
|
<if test="bidCount != null">bid_count = #{bidCount},</if>
|
|
|
<if test="bidPersionCount != null">bid_persion_count = #{bidPersionCount},</if>
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
@@ -303,6 +312,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="groupId != null ">group_id = #{groupId},</if>
|
|
|
<if test="deposit !=null ">deposit=#{deposit},</if>
|
|
|
<if test="serviceTariff !=null ">service_tariff=#{serviceTariff},</if>
|
|
|
+ <if test="payTimeLimit!=null">pay_time_limit=#{payTimeLimit},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
@@ -332,7 +342,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="dealAccountId != null">deal_account_id = #{dealAccountId},</if>
|
|
|
<if test="dealAccount != null">deal_account = #{dealAccount},</if>
|
|
|
<if test="paid != null">paid = #{paid},</if>
|
|
|
- <if test="orderId != null">order_id = #{orderId},</if>
|
|
|
<if test="bidCount != null">bid_count = #{bidCount},</if>
|
|
|
<if test="bidPersionCount != null">bid_persion_count = #{bidPersionCount},</if>
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
@@ -350,7 +359,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="privateDomain != null">private_domain = #{privateDomain},</if>
|
|
|
<if test="1==1">delay_publish = #{delayPublish},</if>
|
|
|
<if test="groupId != null ">group_id = #{groupId},</if>
|
|
|
-
|
|
|
+ <if test="deposit !=null ">deposit=#{deposit},</if>
|
|
|
+ <if test="serviceTariff !=null ">service_tariff=#{serviceTariff},</if>
|
|
|
+ <if test="payTimeLimit!=null">pay_time_limit=#{payTimeLimit},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
@@ -428,7 +439,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="privateDomain != null">private_domain = #{privateDomain},</if>
|
|
|
<if test="1 == 1">delay_publish = #{delayPublish},</if>
|
|
|
<if test="groupId != null ">group_id = #{groupId},</if>
|
|
|
-
|
|
|
+ <if test="deposit !=null ">deposit=#{deposit},</if>
|
|
|
+ <if test="serviceTariff !=null ">service_tariff=#{serviceTariff},</if>
|
|
|
+ <if test="payTimeLimit!=null">pay_time_limit=#{payTimeLimit},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
@@ -457,4 +470,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
status in ('Waiting','Starting','Bidding') and del_flag <> 1 and pub_status = 1
|
|
|
and auction_id=#{auctionId}
|
|
|
</select>
|
|
|
+ <select id="countLotByAucId" resultType="long" parameterType="long">
|
|
|
+ select count(*) from lot where auction_id=#{auctionId} and del_flag <> 1
|
|
|
+ </select>
|
|
|
+ <select id="selectBiddingLotList" resultMap="LotResult">
|
|
|
+ select id, goods_id, auction_id, name, num, unit, imgs, detail, pub_status, pub_time, status, start_time, end_time, real_end_time, rule_type, rule_content, last_price, last_price_time, deal_price, deal_time, deal_account_id, deal_account, paid, bid_count, bid_persion_count, del_flag, create_by, create_time, update_by, update_time, sort,
|
|
|
+ carousel_imgs,merchant_id,merchant_name,merchant_avatar,goods_name,goods_type,private_domain,delay_publish,pub_status,group_id,deposit,service_tariff,pay_time_limit,category,sub_category,properties
|
|
|
+ from
|
|
|
+ lot
|
|
|
+ where
|
|
|
+ status in ('Waiting','Starting','Bidding') and del_flag <> 1 and pub_status = 1
|
|
|
+ order by start_time
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryLotListByCategory" resultMap="LotResult" parameterType="lot">
|
|
|
+ select id, goods_id, auction_id, name, num, unit, imgs, detail, pub_status, pub_time, status, start_time, end_time, real_end_time, rule_type, rule_content, last_price, last_price_time, deal_price, deal_time, deal_account_id, deal_account, paid, bid_count, bid_persion_count, del_flag, create_by, create_time, update_by, update_time, sort,
|
|
|
+ carousel_imgs,merchant_id,merchant_name,merchant_avatar,goods_name,goods_type,private_domain,delay_publish,pub_status,group_id,deposit,service_tariff,pay_time_limit,category,sub_category,properties
|
|
|
+ from
|
|
|
+ lot
|
|
|
+ <where>
|
|
|
+ del_flag <> 1 and pub_status = 1
|
|
|
+ <if test="category!=null and category!=''">
|
|
|
+ and category=#{category}
|
|
|
+ </if>
|
|
|
+ <if test="subCategory!=null and subCategory!=''">
|
|
|
+ and sub_category=#{subCategory}
|
|
|
+ </if>
|
|
|
+ <if test="searchValue!=null and searchValue!=''">
|
|
|
+ and name like concat('%',#{searchValue},'%')
|
|
|
+ </if>
|
|
|
+ <if test="status==1">
|
|
|
+ and status in ('Starting','Bidding')
|
|
|
+ </if>
|
|
|
+ <if test="status==2">
|
|
|
+ and status ='Waiting' and now()>start_time
|
|
|
+ </if>
|
|
|
+ <if test="status==3">
|
|
|
+ and status ='Sold'
|
|
|
+ </if>
|
|
|
+ <if test="status==4">
|
|
|
+ and now()+ interval '1 hour'>end_time and status in ('Starting','Bidding')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|