Commit 7f106c95 by guojuxing

根据名称和企业ID,查询分组数据

parent 890c5bf9
......@@ -116,4 +116,6 @@ public interface TabStoreGroupMapper {
int countByParentId(@Param("parentId") Integer parentId);
int isRepeatName(@Param("storeGroupName") String storeGroupName, @Param("storeGroupId") Integer storeGroupId, @Param("enterpriseId") Integer enterpriseId);
TabStoreGroup getStoreGroupByName(@Param("storeGroupName") String storeGroupName, @Param("enterpriseId") Integer enterpriseId);
}
\ No newline at end of file
package com.gic.store.service;
import com.gic.store.entity.TabStoreGroup;
/**
* @author guojx
* @date 2019/7/3 2:16 PM
*/
public interface StoreGroupService {
/**
* 根据名称查询分组
* @param storeGroupName
* @param enterpriseId
* @return
*/
TabStoreGroup getStoreGroupByName(String storeGroupName, Integer enterpriseId);
}
package com.gic.store.service.impl;
import com.gic.store.dao.mapper.TabStoreGroupMapper;
import com.gic.store.entity.TabStoreGroup;
import com.gic.store.service.StoreGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author guojx
* @date 2019/7/3 2:18 PM
*/
@Service("storeGroupService")
public class StoreGroupServiceImpl implements StoreGroupService{
@Autowired
private TabStoreGroupMapper tabStoreGroupMapper;
@Override
public TabStoreGroup getStoreGroupByName(String storeGroupName, Integer enterpriseId) {
return tabStoreGroupMapper.getStoreGroupByName(storeGroupName, enterpriseId);
}
}
......@@ -241,4 +241,12 @@
and store_group_name = #{storeGroupName}
and enterprise_id = #{enterpriseId}
</select>
<select id="getStoreGroupByName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from
tab_store_group where status = 1 and enterprise_id = #{enterpriseId} and store_group_name = #{storeGroupName}
limit 1
</select>
</mapper>
\ No newline at end of file
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