This commit is contained in:
Carl 2022-02-02 00:20:37 +08:00
parent a57cbe705a
commit 3005334e56

View File

@ -8,6 +8,9 @@
<select id="findAllByCondition" resultMap="ProductSearchTagEntity"> <select id="findAllByCondition" resultMap="ProductSearchTagEntity">
select tag_code,brand_name,tag_name from t_royalcanin_productsearchtag WHERE select tag_code,brand_name,tag_name from t_royalcanin_productsearchtag WHERE
is_delete = 0 is_delete = 0
<if test="petType != null and petType != ''">
AND pet_type = #{petType}
</if>
<if test="brandNameList != null and brandNameList.size > 0"> <if test="brandNameList != null and brandNameList.size > 0">
AND brand_name in AND brand_name in
<foreach collection="brandNameList" open="(" close=")" separator="," item="brandName"> <foreach collection="brandNameList" open="(" close=")" separator="," item="brandName">
@ -21,15 +24,18 @@
#{tagName} #{tagName}
</foreach> </foreach>
</if> </if>
<if test="tagStatus != null and tagStatus == 1"> <if test="tagStatus != null and tagStatus == 1 and tagNameList != null and tagNameList.size > 0">
OR brand_name in ( '专区' ) and tag_name not like '%湿粮%' AND pet_type = #{petType}
</if>
<if test="tagStatus != null and tagStatus == 2 and tagNameList != null and tagNameList.size > 0">
OR brand_name in ( '专区' ) and tag_name like '%湿粮%' AND pet_type = #{petType}
</if>
<if test="tagStatus != null and tagStatus == 1 and tagNameList.size == 0">
AND brand_name in ( '专区' ) and tag_name not like '%湿粮%' AND brand_name in ( '专区' ) and tag_name not like '%湿粮%'
</if> </if>
<if test="tagStatus != null and tagStatus == 2"> <if test="tagStatus != null and tagStatus == 2 and tagNameList.size == 0">
AND brand_name in ( '专区' ) and tag_name like '%湿粮%' AND brand_name in ( '专区' ) and tag_name like '%湿粮%'
</if> </if>
<if test="petType != null and petType != ''">
AND pet_type = #{petType}
</if>
</select> </select>
<delete id="deleteAllProductSearchTag"> <delete id="deleteAllProductSearchTag">