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