xiaoqiang преди 4 години
родител
ревизия
e8c9a823b8
променени са 1 файла, в които са добавени 9 реда и са изтрити 12 реда
  1. 9 12
      src/main/java/org/springblade/sing/active/mapper/ActiveHelpRecordMapper.xml

+ 9 - 12
src/main/java/org/springblade/sing/active/mapper/ActiveHelpRecordMapper.xml

@@ -22,24 +22,21 @@
 
 
     <select id="selectActiveHelpRecordPage" resultMap="activeHelpRecordResultMap">
-        select ahr.*,hg.name helpGoodsName,lu.nick_name userName,apr.title productTitle from sing_active_help_record ahr
-        inner JOIN sing_help_goods hg on ahr.help_goods_id = hg.id
-        inner JOIN sing_login_user lu on ahr.user_id = lu.id
-        inner JOIN sing_active_product_record apr on ahr.product_id = apr.id
-        where ahr.is_deleted = 0
+        select hr.*,g.name helpGoodsName,u.nick_name userName,pr.title productTitle from sing_active_help_record hr
+        inner JOIN sing_help_goods g on hr.help_goods_id = g.id
+        inner JOIN sing_login_user u on hr.user_id = u.id
+        inner JOIN sing_active_product_record pr on hr.product_id = pr.id
+        where hr.is_deleted = 0
         <if test="activeHelpRecord.helpGoodsName != null">
-            and hg.name like concat('%',#{activeHelpRecord.helpGoodsName},'%')
+            and g.name like concat('%',#{activeHelpRecord.helpGoodsName},'%')
         </if>
-
         <if test="activeHelpRecord.productTitle != null">
-            and apr.title concat('%',#{activeHelpRecord.productTitle},'%')
+            and pr.title like concat('%',#{activeHelpRecord.productTitle},'%')
         </if>
-
         <if test="activeHelpRecord.userName != null">
-            and lu.nick_name concat('%',#{activeHelpRecord.userName},'%')
+            and u.nick_name like concat('%',#{activeHelpRecord.userName},'%')
         </if>
-        order by ahr.create_time DESC
-
+        order by hr.create_time DESC
     </select>
 
 </mapper>