修改3-15问题

This commit is contained in:
2023-03-15 18:13:27 +08:00
parent 7cfbdaf947
commit 90c0a9bfdf
10 changed files with 72 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@@ -65,5 +66,9 @@ public class BuildWuyeCompany implements Serializable {
private String phone;
@ApiModelProperty("关键字")
@TableField(exist = false)
private String keyword;
}

View File

@@ -3,6 +3,7 @@ package com.zscat.mallplus.pms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zscat.mallplus.pms.entity.PmsProductCategory;
import com.zscat.mallplus.pms.vo.PmsProductCategoryWithChildrenItem;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -17,4 +18,8 @@ import java.util.List;
public interface PmsProductCategoryMapper extends BaseMapper<PmsProductCategory> {
List<PmsProductCategoryWithChildrenItem> listWithChildren();
int selectCountByNameAndLevel(@Param("parentId") Long parentId, @Param("name") String name);
int selectCountByNameAndLevelId(@Param("parentId") Long parentId, @Param("name") String name, @Param("id") Long id);
}

View File

@@ -39,4 +39,12 @@
from pms_product_category c1 left join pms_product_category c2 on c1.id = c2.parent_id
where c1.parent_id = 0
</select>
<select id="selectCountByNameAndLevel" resultType="int">
select count(*) from pms_product_category where parent_id = #{parentId} and name = #{name}
</select>
<select id="selectCountByNameAndLevelId" resultType="int">
select count(*) from pms_product_category where parent_id = #{parentId} and name = #{name} and id &lt;&gt; #{id}
</select>
</mapper>