main
tamguo 7 years ago
parent a00856bb52
commit d607a0b5ae

@ -27,6 +27,7 @@ public class SysUserEntity extends SuperEntity<SysUserEntity> implements Seriali
private String password;
private String roleIds;
private String companyId;
private String companyIds;
private Date createDate;
private Date updateDate;
@ -165,5 +166,13 @@ public class SysUserEntity extends SuperEntity<SysUserEntity> implements Seriali
this.createDate = createDate;
}
public String getCompanyIds() {
return companyIds;
}
public void setCompanyIds(String companyIds) {
this.companyIds = companyIds;
}
}

@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.plugins.Page;
import com.tamguo.modules.sys.dao.SysUserMapper;
import com.tamguo.modules.sys.model.SysUserEntity;
@ -26,6 +27,15 @@ public class SysUserServiceImpl implements ISysUserService{
@Transactional(readOnly=false)
@Override
public Page<SysUserEntity> listData(SysUserCondition condition) {
if(!StringUtils.isEmpty(condition.getCompanyCode())) {
condition.setCompanyCode("%" + condition.getCompanyCode() + "%");
}
if(!StringUtils.isEmpty(condition.getName())) {
condition.setName("%" + condition.getName() + "%");
}
if(!StringUtils.isEmpty(condition.getNickName())) {
condition.setNickName("%" + condition.getNickName() + "%");
}
Page<SysUserEntity> page = new Page<>(condition.getPageNo() , condition.getPageSize());
return page.setRecords(sysUserMapper.listData(condition , page));
}

@ -68,10 +68,13 @@ public class Result implements Serializable {
int totalPage) {
Map<String, Object> result = new HashMap<String, Object>();
result.put("list", list);
result.put("totalCount", totalCount);
result.put("count", totalCount);
result.put("next", currPage == totalPage ? currPage : currPage + 1);
result.put("prev", currPage == 1 ? 1 : currPage - 1);
result.put("first", 1);
result.put("last", totalPage);
result.put("pageSize", pageSize);
result.put("currPage", currPage);
result.put("totalPage", totalPage);
result.put("pageNo", currPage);
return result;
}

@ -39,7 +39,7 @@
<where>
1 = 1
<if test="userName != null and userName != ''">
and u.user_name like #{userName}
and u.user_name = #{userName}
</if>
<if test="nickName != null and nickName != ''">
and u.nick_name like #{nickName}
@ -48,7 +48,7 @@
and u.nick_name like #{nickName}
</if>
<if test="companyCode != null and companyCode != ''">
and u.company_id = #{companyCode}
and u.company_ids like #{companyCode}
</if>
<if test="email != null and email != ''">
and u.email = #{email}

Loading…
Cancel
Save