Forráskód Böngészése

修改bug: U店在这#981

ssk 1 hónapja
szülő
commit
d3013cb9c4

+ 7 - 15
alien-entity/src/main/java/shop/alien/mapper/LifeUserMapper.java

@@ -32,23 +32,15 @@ public interface LifeUserMapper extends BaseMapper<LifeUser> {
             "where delete_flag = 0 and substring_index(#{phoneId}, '_', 1) = 'user' and substring_index(#{phoneId}, '_', -1) = user_phone")
     LifeFansVo getUserInfoByPhoneId(@Param("phoneId") String phoneId);
 
-
     LifeFansVo getUserInfoByPhoneIdList(@Param("phoneId") String phoneId);
 
-
-    @Select("select * from ( " +
-            "    select store.id, concat('store_', user.phone) phoneId, img.img_url imgUrl, store_blurb blurb, store.store_name storeUserName " +
-            "    from store_info store " +
-            "    join store_user user on user.store_id = store.id " +
-            "    left join store_img img on img.store_id = store.id and img.img_type = '10' and img.delete_flag = 0 " +
-            "    where store.delete_flag = 0 " +
-            "    and user.delete_flag = 0 " +
-            "    union all " +
-            "    select id, concat('user_', user_phone) phoneId, user_image imgUrl, jianjie blurb, user_name name " +
-            "    from life_user " +
-            "    where delete_flag = 0 " +
-            ") a " +
-            "${ew.customSqlSegment}")
+    @Select("SELECT * FROM ( " +
+            " SELECT store.id, concat( 'store_', USER.phone ) phoneId, USER.head_img imgUrl, store_blurb blurb, " +
+            " if(store.id is null,USER.name ,store.store_name) storeUserName " +
+            " FROM store_user USER LEFT JOIN store_info store ON USER.store_id = store.id  and USER.delete_flag = 0 and  store.delete_flag = 0  " +
+            " UNION ALL SELECT id, concat( 'user_', user_phone ) phoneId, user_image imgUrl, jianjie blurb, user_name NAME " +
+            " FROM life_user WHERE delete_flag = 0 ) a " +
+            " ${ew.customSqlSegment}")
     IPage<LifeUserVo> getStoreAndUserByName(IPage<LifeUserVo> iPage, @Param(Constants.WRAPPER) QueryWrapper<LifeUserVo> wrapper);
 
     LifeUserVo getRemoveUser(@Param("id") String id);