action:
List<CompanyMemberLevelConfigVo>list=companyMemberLevelConfigMapper.checkMemberLevelName(companyMemberLevelConfigVo);
if(companyMemberLevelConfigVo.getMethod().equals("add")){
//重复了
if(list.size()>0){
return true;
}
}
if(companyMemberLevelConfigVo.getMethod().equals("update")){
//重复了
if (list.size() > 0 && !list.get(0).getId().equals(companyMemberLevelConfigVo.getId())) {
return true;
}
}
return false;
sql:
select * from company_member_level_config cmlc
where cmlc.name=#{name}
and cmlc.company_id=#{companyId}
and cmlc.del_flag=0;
js:
if(jsonData){
$(".nameMsg").html("会员等级名称不能重复!");
$(".nameMsg").css("color","red");
return;
需要传递的参数:
name
method
id