fix: 更新SQL脚本并优化商品查询SQL
更新多个表的corpid字段值为统一值,确保数据一致性 优化商品查询SQL,明确指定查询字段避免潜在问题
This commit is contained in:
parent
848f9d9606
commit
6313299722
|
@ -64,7 +64,9 @@ public interface ShopGoodsMapper extends BaseMapper<ShopGoodsEntity> {
|
|||
* 查询商品及其关联的柜机格口信息
|
||||
* @return 商品列表
|
||||
*/
|
||||
@Select("SELECT g.*, " +
|
||||
@Select("SELECT g.goods_id, g.goods_name, g.category_id, g.price, " +
|
||||
"g.status, g.cover_img, g.goods_detail, g.usage_instruction, g.belong_type, " +
|
||||
"g.creator_id, g.create_time, g.updater_id, g.update_time, g.remark, g.deleted, " +
|
||||
"sc.cabinet_id, sc.cabinet_name, cc.stock, cc.cell_id " +
|
||||
"FROM shop_goods g " +
|
||||
"LEFT JOIN cabinet_cell cc ON g.goods_id = cc.goods_id " +
|
||||
|
@ -72,7 +74,9 @@ public interface ShopGoodsMapper extends BaseMapper<ShopGoodsEntity> {
|
|||
"WHERE g.deleted = 0 AND g.belong_type = 0 AND sc.deleted = 0 AND cc.deleted = 0 AND cc.goods_id IS NOT NULL ")
|
||||
List<SearchGoodsWithCabinetDO> getGoodsWithCabinetList();
|
||||
|
||||
@Select("SELECT g.*, " +
|
||||
@Select("SELECT g.goods_id, g.goods_name, g.category_id, g.price, " +
|
||||
"g.status, g.cover_img, g.goods_detail, g.usage_instruction, g.belong_type, " +
|
||||
"g.creator_id, g.create_time, g.updater_id, g.update_time, g.remark, g.deleted, " +
|
||||
"sc.cabinet_id, sc.cabinet_name, sc.shop_id, cc.stock, cc.cell_id " +
|
||||
"FROM shop_goods g " +
|
||||
"LEFT JOIN cabinet_cell cc ON g.goods_id = cc.goods_id " +
|
||||
|
|
|
@ -73,4 +73,10 @@ AFTER `corpid`;
|
|||
|
||||
ALTER TABLE `shop_order_goods`
|
||||
ADD COLUMN `approval_id` bigint NULL COMMENT '审批ID'
|
||||
AFTER `order_id`;
|
||||
AFTER `order_id`;
|
||||
|
||||
UPDATE shop_goods SET corpid = 'wpZ1ZrEgAA2QTxIRcB4cMtY7hQbTcPAw';
|
||||
UPDATE return_approval SET corpid = 'wpZ1ZrEgAA2QTxIRcB4cMtY7hQbTcPAw';
|
||||
UPDATE shop SET corpid = 'wpZ1ZrEgAA2QTxIRcB4cMtY7hQbTcPAw';
|
||||
UPDATE shop_order SET corpid = 'wpZ1ZrEgAA2QTxIRcB4cMtY7hQbTcPAw';
|
||||
UPDATE shop_order_goods SET corpid = 'wpZ1ZrEgAA2QTxIRcB4cMtY7hQbTcPAw';
|
Loading…
Reference in New Issue