Эх сурвалжийг харах

拍卖会关联查询拍品数量

linhui.li 3 долоо хоног өмнө
parent
commit
3675508c05

+ 3 - 1
auc/src/main/java/cn/hobbystocks/auc/web/LotController.java

@@ -14,6 +14,7 @@ import cn.hobbystocks.auc.domain.Bid;
 import cn.hobbystocks.auc.domain.Lot;
 import cn.hobbystocks.auc.common.constant.Constants;
 import cn.hobbystocks.auc.mapper.BidMapper;
+import cn.hobbystocks.auc.service.IAuctionService;
 import cn.hobbystocks.auc.service.SyncService;
 import cn.hobbystocks.auc.task.DynamicTaskService;
 import cn.hobbystocks.auc.vo.LotVO;
@@ -41,10 +42,11 @@ public class LotController extends AdminBaseController {
 	@Autowired
 	private SyncService syncService;
 	@Autowired
-	private AppClient appClient;
+	private IAuctionService auctionService;
 	@Autowired
 	private BidMapper bidMapper;
 
+
 	/**
 	 * 查询拍品列表
 	 */

+ 4 - 0
lot/src/main/java/cn/hobbystocks/auc/domain/Auction.java

@@ -81,7 +81,11 @@ public class Auction extends BaseEntity {
     private Integer delFlag;
     //商家id
     @ApiModelProperty("商家id")
+    @TableField("merchant_id")
     private Long merchantId;
+    @ApiModelProperty("拍品数量")
+    @TableField("lot_num")
+    private Long lotNum;
     //排序
     @ApiModelProperty("排序,值越大排名越靠前")
     private Integer sort;

+ 3 - 1
lot/src/main/resources/mapper/AuctionMapper.xml

@@ -26,6 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="sort" column="sort"/>
+        <association property="lotNum" column="id" select="cn.hobbystocks.auc.mapper.LotMapper.countLotByAucId">
+        </association>
     </resultMap>
 
     <sql id="selectAuctionVo">
@@ -44,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auction.pubStatus != null "> and pub_status = #{auction.pubStatus}</if>
             and del_flag &lt;&gt; 1
         </where>
-        order by sort desc,id asc
+        order by sort desc,id desc
     </select>
 
     <select id="selectPubbedAndNoEndAuction" resultMap="AuctionResult">

+ 3 - 0
lot/src/main/resources/mapper/LotMapper.xml

@@ -453,4 +453,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         status in ('Waiting','Starting','Bidding') and del_flag &lt;&gt; 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 &lt;&gt; 1
+    </select>
 </mapper>