Commit 20ab8260 by guojuxing

品牌编辑变成新增修改

parent 7cf16019
......@@ -56,7 +56,7 @@ public interface TabPlatformBrandMapper {
*/
int updateByPrimaryKey(TabPlatformBrand record);
TabPlatformBrand getByBrandName(@Param("platformBrandName") String platformBrandName);
TabPlatformBrand getByBrandName(@Param("platformBrandName") String platformBrandName, @Param("platformBrandId") String platformBrandId);
Page<TabPlatformBrand> listPlatformBrand(PlatformBrandDTO platformBrandDTO);
......
......@@ -9,6 +9,8 @@ import java.util.List;
public interface PlatformBrandService {
TabPlatformBrand getByBrandName(String platformBrandName);
TabPlatformBrand getByBrandNameAndId(String platformBrandName, Integer platformBrandId);
Integer save(PlatformBrandDTO platformBrandDTO);
Integer update(PlatformBrandDTO platformBrandDTO);
......
......@@ -21,7 +21,12 @@ public class PlatformBrandServiceImpl implements PlatformBrandService {
@Override
public TabPlatformBrand getByBrandName(String platformBrandName) {
return tabPlatformBrandMapper.getByBrandName(platformBrandName);
return tabPlatformBrandMapper.getByBrandName(platformBrandName, null);
}
@Override
public TabPlatformBrand getByBrandNameAndId(String platformBrandName, Integer platformBrandId) {
return tabPlatformBrandMapper.getByBrandName(platformBrandName, platformBrandName);
}
@Override
......@@ -43,6 +48,7 @@ public class PlatformBrandServiceImpl implements PlatformBrandService {
tabPlatformBrand.setPlatformBrandCategoryCode(platformBrandDTO.getPlatformBrandCategoryCode());
tabPlatformBrand.setPlatformBrandCategoryName(platformBrandDTO.getPlatformBrandCategoryName());
tabPlatformBrand.setPlatformBrandName(platformBrandDTO.getPlatformBrandName());
tabPlatformBrand.setPlatformBrandId(platformBrandDTO.getPlatformBrandId());
return tabPlatformBrandMapper.updateByPrimaryKeySelective(tabPlatformBrand);
}
......
......@@ -136,6 +136,9 @@
<include refid="Base_Column_List" />
from tab_platform_brand
where platform_brand_name = #{platformBrandName}
<if test="platformBrandId != null">
and platform_brand_id &lt;&gt; #{platformBrandId}
</if>
and status = 1
</select>
<select id="listPlatformBrand" resultMap="BaseResultMap">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment