企业名称查重
parent
9c84548f12
commit
a4aa60c540
|
|
@ -145,7 +145,10 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
||||||
public Long checkCorpName(Map<String, Object> parmas) {
|
public Long checkCorpName(Map<String, Object> parmas) {
|
||||||
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("corp_name", parmas.get("corpName"));
|
queryWrapper.eq("corp_name", parmas.get("corpName"));
|
||||||
|
if(!ObjectUtil.isEmpty(parmas.get("id"))){
|
||||||
queryWrapper.ne("id", parmas.get("id"));
|
queryWrapper.ne("id", parmas.get("id"));
|
||||||
|
}
|
||||||
|
|
||||||
return corpInfoMapper.selectCount(queryWrapper);
|
return corpInfoMapper.selectCount(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.zcloud.basic.info.persistence.repository.impl;
|
package com.zcloud.basic.info.persistence.repository.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.dto.Response;
|
import com.alibaba.cola.dto.Response;
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,10 @@
|
||||||
<select id="countUser" resultType="Integer">
|
<select id="countUser" resultType="Integer">
|
||||||
select count(1)
|
select count(1)
|
||||||
from user
|
from user
|
||||||
where id != #{params.id}
|
<where>
|
||||||
|
<if test="params.id != null">
|
||||||
|
and id != #{params.id}
|
||||||
|
</if>
|
||||||
<if test="params.username != null">
|
<if test="params.username != null">
|
||||||
and username = #{params.username}
|
and username = #{params.username}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -262,6 +265,7 @@
|
||||||
<if test="params.phone != null">
|
<if test="params.phone != null">
|
||||||
and phone = #{params.phone}
|
and phone = #{params.phone}
|
||||||
</if>
|
</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue