From f42983b35c738a28ed4b9d1732d1045c5f2a19bb Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期日, 09 五月 2021 16:57:12 +0800
Subject: [PATCH] 优化代码
---
java110-db/src/main/resources/mapper/common/AdvertServiceDaoImplMapper.xml | 71 +++++++++++++++++++++++++++--------
1 files changed, 54 insertions(+), 17 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/common/AdvertServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/common/AdvertServiceDaoImplMapper.xml
old mode 100644
new mode 100755
index 5247b32..72eac6b
--- a/java110-db/src/main/resources/mapper/common/AdvertServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/common/AdvertServiceDaoImplMapper.xml
@@ -6,13 +6,10 @@
<!-- 淇濆瓨骞垮憡淇℃伅淇℃伅 add by wuxw 2018-07-03 -->
<insert id="saveBusinessAdvertInfo" parameterType="Map">
- insert into business_advert(
-classify,ad_name,location_type_cd,ad_type_cd,advert_id,operate,start_time,state,end_time,community_id,b_id,location_obj_id,seq
-) values (
-#{classify},#{adName},#{locationTypeCd},#{adTypeCd},#{advertId},#{operate},#{startTime},#{state},#{endTime},#{communityId},#{bId},#{locationObjId},#{seq}
-)
- </insert>
-
+ insert into business_advert(classify,ad_name,location_type_cd,ad_type_cd,advert_id,operate,start_time,state,end_time,community_id,b_id,location_obj_id,seq)
+ values
+ (#{classify},#{adName},#{locationTypeCd},#{adTypeCd},#{advertId},#{operate},#{startTime},#{state},#{endTime},#{communityId},#{bId},#{locationObjId},#{seq})
+ </insert>
<!-- 鏌ヨ骞垮憡淇℃伅淇℃伅锛圔usiness锛� add by wuxw 2018-07-03 -->
<select id="getBusinessAdvertInfo" parameterType="Map" resultType="Map">
@@ -62,9 +59,7 @@
<if test="seq !=null and seq != ''">
and t.seq= #{seq}
</if>
-
</select>
-
<!-- 淇濆瓨骞垮憡淇℃伅淇℃伅鑷� instance琛ㄤ腑 add by wuxw 2018-07-03 -->
<insert id="saveAdvertInfoInstance" parameterType="Map">
@@ -110,16 +105,60 @@
<if test="seq !=null and seq != ''">
and t.seq= #{seq}
</if>
-
</insert>
+ <!-- 淇敼骞垮憡淇℃伅 -->
+ <update id="updateAdvert" parameterType="Map">
+ update advert t set t.status_cd = #{statusCd}
+ <if test="bId != null and bId != ''">
+ ,t.b_id = #{bId}
+ </if>
+ <if test="classify !=null and classify != ''">
+ , t.classify= #{classify}
+ </if>
+ <if test="adName !=null and adName != ''">
+ , t.ad_name= #{adName}
+ </if>
+ <if test="locationTypeCd !=null and locationTypeCd != ''">
+ , t.location_type_cd= #{locationTypeCd}
+ </if>
+ <if test="adTypeCd !=null and adTypeCd != ''">
+ , t.ad_type_cd= #{adTypeCd}
+ </if>
+ <if test="startTime !=null ">
+ , t.start_time= #{startTime}
+ </if>
+ <if test="state !=null and state != ''">
+ , t.state= #{state}
+ </if>
+ <if test="endTime !=null ">
+ , t.end_time= #{endTime}
+ </if>
+ <if test="communityId !=null and communityId != ''">
+ , t.community_id= #{communityId}
+ </if>
+ <if test="locationObjId !=null and locationObjId != ''">
+ , t.location_obj_id= #{locationObjId}
+ </if>
+ <if test="seq !=null and seq != ''">
+ , t.seq= #{seq}
+ </if>
+ where 1=1
+ <if test="advertId !=null and advertId != ''">
+ and t.advert_id= #{advertId}
+ </if>
+ <!--<if test="bId !=null and bId != ''">
+ and t.b_id= #{bId}
+ </if>-->
+ </update>
<!-- 鏌ヨ骞垮憡淇℃伅淇℃伅 add by wuxw 2018-07-03 -->
<select id="getAdvertInfo" parameterType="Map" resultType="Map">
select t.classify,t.ad_name,t.ad_name adName,t.location_type_cd,t.location_type_cd
locationTypeCd,t.status_cd,t.status_cd statusCd,t.ad_type_cd,t.ad_type_cd adTypeCd,t.advert_id,t.advert_id
advertId,t.start_time,t.start_time startTime,t.state,t.end_time,t.end_time endTime,t.community_id,t.community_id
- communityId,t.b_id,t.b_id bId,t.location_obj_id,t.location_obj_id locationObjId,t.seq,td1.name classifyName,td2.name stateName
+ communityId,t.b_id,t.b_id bId,t.location_obj_id,t.location_obj_id locationObjId,t.seq,td1.name
+ classifyName,td2.name stateName,t.create_time createTime
from advert t,t_dict td1,t_dict td2
where 1 =1
and t.classify = td1.status_cd
@@ -167,12 +206,14 @@
<if test="seq !=null and seq != ''">
and t.seq= #{seq}
</if>
+ <if test="createTime != null and createTime != ''">
+ and t.create_Time = #{createTime}
+ </if>
+ order by t.create_time desc
<if test="page != -1 and page != null ">
limit #{page}, #{row}
</if>
-
</select>
-
<!-- 淇敼骞垮憡淇℃伅淇℃伅 add by wuxw 2018-07-03 -->
<update id="updateAdvertInfoInstance" parameterType="Map">
@@ -217,7 +258,6 @@
<if test="bId !=null and bId != ''">
and t.b_id= #{bId}
</if>
-
</update>
<!-- 鏌ヨ骞垮憡淇℃伅鏁伴噺 add by wuxw 2018-07-03 -->
@@ -270,8 +310,5 @@
<if test="seq !=null and seq != ''">
and t.seq= #{seq}
</if>
-
-
</select>
-
</mapper>
--
Gitblit v1.8.0