Просмотр исходного кода

feat(business): 为物品添加价值字段并优化用户查询

- 在 Items、ItemsBo 和 ItemsVo 类中添加 itemValue 字段- 更新 ItemsMapper.xml 以支持 item_value 列的查询和更新
- 修改 UserServiceImpl 中的用户查询条件,使用模糊匹配
fugui001 5 месяцев назад
Родитель
Сommit
e3d0a5ce65

+ 1 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/Items.java

@@ -54,5 +54,6 @@ public class Items extends BaseEntity {
      */
     private Date updatedAt;
 
+    private Long itemValue;
 
 }

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/bo/ItemsBo.java

@@ -60,4 +60,6 @@ public class ItemsBo extends BaseEntity {
      */
     private Integer ranking;
 
+
+    private Long itemValue;
 }

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/vo/ItemsVo.java

@@ -61,4 +61,6 @@ public class ItemsVo implements Serializable {
     private Date updatedAt;
 
 
+    private Long itemValue;
+
 }

+ 2 - 2
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/service/impl/UserServiceImpl.java

@@ -121,7 +121,7 @@ public class UserServiceImpl implements IUserService {
 
         // a.phone
         if (StringUtils.isNotBlank(bo.getPhone())) {
-            wrapper.eq("a.phone", bo.getPhone());
+            wrapper.like("a.phone", bo.getPhone());
         }
 
         // a.create_at
@@ -141,7 +141,7 @@ public class UserServiceImpl implements IUserService {
 
         // a.email
         if (StringUtils.isNotBlank(bo.getEmail())) {
-            wrapper.eq("a.email", bo.getEmail());
+            wrapper.like("a.email", bo.getEmail());
         }
 
         // a.nick_name

+ 9 - 4
ruoyi-modules/ruoyi-system/src/main/resources/mapper/business/ItemsMapper.xml

@@ -6,17 +6,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectVoPage" resultType="org.dromara.business.domain.vo.ItemsVo">
-        SELECT id, name, item_type,item_desc, created_at, updated_at
+        SELECT id, name, item_type,item_desc, created_at, updated_at,item_value
         FROM items ${ew.customSqlSegment}
     </select>
 
 
     <select id="selectItemsList" resultType="org.dromara.business.domain.vo.ItemsVo">
-        SELECT  id, name, item_type,item_desc, created_at, updated_at FROM items  ${ew.customSqlSegment}
+        SELECT  id, name, item_type,item_desc, created_at, updated_at,item_value FROM items  ${ew.customSqlSegment}
     </select>
 
     <select id="selectVoByIdInfo" resultType="org.dromara.business.domain.vo.ItemsVo">
-        SELECT  id, name, item_type,item_desc, created_at, updated_at FROM items WHERE id =  #{id}
+        SELECT  id, name, item_type,item_desc, created_at, updated_at,item_value FROM items WHERE id =  #{id}
     </select>
 
     <update id="updateItemsById">
@@ -31,6 +31,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="itemDesc != null and itemDesc != ''">
                 item_desc = #{itemDesc},
             </if>
+            <if test="itemValue != null and itemValue != ''">
+                item_value = #{itemValue},
+            </if>
             updated_at = NOW()
         </set>
         WHERE id = #{id}
@@ -43,11 +46,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="name != null and name != ''">name,</if>
             <if test="itemType != null and itemType != ''">item_type,</if>
             <if test="itemDesc != null and itemDesc != ''">item_desc,</if>
+            <if test="itemValue != null and itemValue != ''">item_value,</if>
         </trim>
         <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
             <if test="name != null and name != ''">#{name},</if>
             <if test="itemType != null and itemType != ''">#{itemType},</if>
             <if test="itemDesc != null and itemDesc != ''">#{itemDesc},</if>
+            <if test="itemValue != null and itemValue != ''">#{itemValue},</if>
         </trim>
     </insert>
 
@@ -66,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectItemsSelList" resultType="org.dromara.business.domain.vo.ItemsVo">
-        SELECT  id, name, item_type,item_desc, created_at, updated_at FROM items
+        SELECT  id, name, item_type,item_desc, created_at, updated_at,item_value FROM items
     </select>
 
 </mapper>