no message
This commit is contained in:
parent
e2ec85c7ae
commit
10835cd1a7
|
|
@ -79,9 +79,9 @@ public class ShopController extends BaseController {
|
|||
// }
|
||||
// }
|
||||
|
||||
@GetMapping("/customer/{customerId}")
|
||||
public AjaxResult getShopsByCustomerId(@PathVariable Long customerId) {
|
||||
List<Shop> shops = shopService.getShopsByCustomerId(customerId);
|
||||
@GetMapping("/worker/{workerId}")
|
||||
public AjaxResult getShopsByWorkerId(@PathVariable Long workerId) {
|
||||
List<Shop> shops = shopService.getShopsByWorkerId(workerId);
|
||||
return AjaxResult.success(shops);
|
||||
}
|
||||
}
|
||||
|
|
@ -11,7 +11,7 @@ public class Shop implements Serializable {
|
|||
private Long shopId; // 店铺ID
|
||||
private String shopName; // 店铺名称
|
||||
private String imageUrl; // 店铺图片
|
||||
private Long customerId; // 用户ID
|
||||
private Long workerId; // 工作人员ID
|
||||
|
||||
private Long provinceId;
|
||||
private String provinceName;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public interface ShopMapper {
|
|||
List<Shop> selectAll();
|
||||
|
||||
/**
|
||||
* 根据用户ID查询商铺列表
|
||||
* 根据工作人员ID查询商铺列表
|
||||
*/
|
||||
List<Shop> selectShopsByCustomerId(@Param("customerId") Long customerId);
|
||||
List<Shop> selectShopsByWorkerId(@Param("workerId") Long workerId);
|
||||
}
|
||||
|
|
@ -11,7 +11,7 @@ public interface ShopService {
|
|||
List<Shop> listShops();
|
||||
|
||||
/**
|
||||
* 根据用户ID查询商铺列表
|
||||
* 根据工作人员ID查询商铺列表
|
||||
*/
|
||||
List<Shop> getShopsByCustomerId(Long customerId);
|
||||
List<Shop> getShopsByWorkerId(Long workerId);
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ public class ShopServiceImpl implements ShopService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Shop> getShopsByCustomerId(Long customerId) {
|
||||
return shopMapper.selectShopsByCustomerId(customerId);
|
||||
public List<Shop> getShopsByWorkerId(Long workerId) {
|
||||
return shopMapper.selectShopsByWorkerId(workerId);
|
||||
}
|
||||
}
|
||||
|
|
@ -64,10 +64,10 @@
|
|||
SELECT * FROM shop
|
||||
</select>
|
||||
|
||||
<select id="selectShopsByCustomerId" resultMap="ShopResultMap">
|
||||
<select id="selectShopsByWorkerId" resultMap="ShopResultMap">
|
||||
select *
|
||||
from shop
|
||||
where customer_id = #{customerId}
|
||||
where worker_id = #{workerId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue