From 62f2b98b64f6726ca7cb90cbfa996deaac4ffba9 Mon Sep 17 00:00:00 2001
From: xiaogang <905166056@qq.com>
Date: 星期四, 02 十一月 2023 14:09:04 +0800
Subject: [PATCH] 1、优化查询,便于模糊查询条件2、界面查询条件调整
---
java110-db/src/main/resources/mapper/common/CommunityPublicityV1ServiceDaoImplMapper.xml | 27 +++++++++------------------
1 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/common/CommunityPublicityV1ServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/common/CommunityPublicityV1ServiceDaoImplMapper.xml
index 6b4d526..9da9e87 100644
--- a/java110-db/src/main/resources/mapper/common/CommunityPublicityV1ServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/common/CommunityPublicityV1ServiceDaoImplMapper.xml
@@ -1,19 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="communityPublicityV1ServiceDaoImpl">
-
<!-- 淇濆瓨灏忓尯鍏ず淇℃伅 add by wuxw 2018-07-03 -->
<insert id="saveCommunityPublicityInfo" parameterType="Map">
- insert into community_publicity(
- create_user_id,pub_id,context,collect_count,pub_type,like_count,create_user_name,title,community_id,read_count,header_img
- ) values (
- #{createUserId},#{pubId},#{context},#{collectCount},#{pubType},#{likeCount},#{createUserName},#{title},#{communityId},#{readCount},#{headerImg}
- )
+ insert into community_publicity(create_user_id, pub_id, context, collect_count, pub_type, like_count,
+ create_user_name, title, community_id, read_count, header_img)
+ values (#{createUserId}, #{pubId}, #{context}, #{collectCount}, #{pubType}, #{likeCount}, #{createUserName},
+ #{title}, #{communityId}, #{readCount}, #{headerImg})
</insert>
-
<!-- 鏌ヨ灏忓尯鍏ず淇℃伅 add by wuxw 2018-07-03 -->
<select id="getCommunityPublicityInfo" parameterType="Map" resultType="Map">
@@ -24,7 +20,8 @@
communityId,t.read_count,t.read_count readCount,t.header_img,t.header_img headerImg,
t.create_time createTime,td.`name` pubTypeName
from community_publicity t
- left join t_dict td on t.pub_type = td.status_cd and td.table_name = 'community_publicity' and td.table_columns = 'pub_type'
+ left join t_dict td on t.pub_type = td.status_cd and td.table_name = 'community_publicity' and td.table_columns
+ = 'pub_type'
where 1 =1
<if test="createUserId !=null and createUserId != ''">
and t.create_user_id= #{createUserId}
@@ -51,7 +48,7 @@
and t.status_cd= #{statusCd}
</if>
<if test="title !=null and title != ''">
- and t.title= #{title}
+ and t.title like concat('%',#{title},'%')
</if>
<if test="communityId !=null and communityId != ''">
and t.community_id= #{communityId}
@@ -66,9 +63,7 @@
<if test="page != -1 and page != null ">
limit #{page}, #{row}
</if>
-
</select>
-
<!-- 淇敼灏忓尯鍏ず淇℃伅 add by wuxw 2018-07-03 -->
<update id="updateCommunityPublicityInfo" parameterType="Map">
@@ -110,7 +105,6 @@
<if test="pubId !=null and pubId != ''">
and t.pub_id= #{pubId}
</if>
-
</update>
<!-- 鏌ヨ灏忓尯鍏ず鏁伴噺 add by wuxw 2018-07-03 -->
@@ -143,7 +137,7 @@
and t.status_cd= #{statusCd}
</if>
<if test="title !=null and title != ''">
- and t.title= #{title}
+ and t.title like concat('%',#{title},'%')
</if>
<if test="communityId !=null and communityId != ''">
and t.community_id= #{communityId}
@@ -154,8 +148,5 @@
<if test="headerImg !=null and headerImg != ''">
and t.header_img= #{headerImg}
</if>
-
-
</select>
-
</mapper>
--
Gitblit v1.8.0