Authored by ZhongW

Update getShopTopArea.md

@@ -20,11 +20,20 @@ @@ -20,11 +20,20 @@
20 ### 对应SQL的操作库表 20 ### 对应SQL的操作库表
21 21
22 ```xml 22 ```xml
23 - <select id="selectShopTopArea">  
24 - select * from shop_top_area where rank<11 and shop_id=#{shopId,jdbcType=INTEGER}  
25 - and date_id=#{dateId,jdbcType=INTEGER}  
26 - union all  
27 - select * from shop_top_area where shop_id = -1 and date_id=#{dateId,jdbcType=INTEGER} 23 + <select id="selectShopTopAreaByShopId" resultMap="BaseResultMap">
  24 + select
  25 + <include refid="Base_Column_List"/>
  26 + from shop_top_area
  27 + <where>
  28 + <if test="shopTopArea.shopId != null ">
  29 + and shop_id=#{shopTopArea.shopId,jdbcType=INTEGER}
  30 + </if>
  31 + <if test="shopTopArea.shopId != null ">
  32 + and date_id=#{shopTopArea.dateId,jdbcType=INTEGER}
  33 + </if>
  34 + </where>
  35 + order by order_rate desc
  36 + limit 10
28 </select> 37 </select>
29 ``` 38 ```
30 39