测试修改
This commit is contained in:
parent
1311fea613
commit
2df173ba58
|
|
@ -82,5 +82,5 @@ public interface MaTypeMapper {
|
|||
|
||||
int deletePropSetByTypeId(Long typeId);
|
||||
|
||||
int getMaType(MaType maType);
|
||||
MaType getMaType(MaType maType);
|
||||
}
|
||||
|
|
@ -72,8 +72,8 @@ public class MaTypeServiceImpl implements ITypeService {
|
|||
maType.setCreateTime(DateUtils.getNowDate());
|
||||
//根据类型名称判重
|
||||
if (maType.getTypeName() != null && maType.getParentId() != null) {
|
||||
int num = maTypeMapper.getMaType(maType);
|
||||
if (num > 0) {
|
||||
MaType mapperMaType = maTypeMapper.getMaType(maType);
|
||||
if (mapperMaType != null) {
|
||||
throw new ServiceException("机具类型名称与库中重复,请修改后重新提交!");
|
||||
}
|
||||
}
|
||||
|
|
@ -132,8 +132,8 @@ public class MaTypeServiceImpl implements ITypeService {
|
|||
maType.setUpdateTime(DateUtils.getNowDate());
|
||||
//根据类型名称判重
|
||||
if (maType.getTypeName() != null && maType.getParentId() != null) {
|
||||
int num = maTypeMapper.getMaType(maType);
|
||||
if (num > 0) {
|
||||
MaType mapperMaType = maTypeMapper.getMaType(maType);
|
||||
if (mapperMaType != null && mapperMaType.getTypeId() != null && !mapperMaType.getTypeId().equals(maType.getTypeId())) {
|
||||
throw new ServiceException("机具类型名称与库中重复,请修改后重新提交!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -416,8 +416,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getMaType" resultType="java.lang.Integer">
|
||||
select count(1) from ma_type where parent_id = #{parentId} and type_name = #{typeName}
|
||||
<select id="getMaType" resultType="com.bonus.sgzb.base.api.domain.MaType">
|
||||
SELECT
|
||||
type_id AS typeId,
|
||||
type_name AS typeName,
|
||||
parent_id AS parentId
|
||||
FROM
|
||||
ma_type
|
||||
WHERE
|
||||
parent_id = #{parentId} and type_name = #{typeName}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue