给租户查询接口增加备注查询字段
This commit is contained in:
@@ -12,11 +12,13 @@ public interface TenantMapperEx {
|
|||||||
@Param("loginName") String loginName,
|
@Param("loginName") String loginName,
|
||||||
@Param("type") String type,
|
@Param("type") String type,
|
||||||
@Param("enabled") String enabled,
|
@Param("enabled") String enabled,
|
||||||
|
@Param("remark") String remark,
|
||||||
@Param("offset") Integer offset,
|
@Param("offset") Integer offset,
|
||||||
@Param("rows") Integer rows);
|
@Param("rows") Integer rows);
|
||||||
|
|
||||||
Long countsByTenant(
|
Long countsByTenant(
|
||||||
@Param("loginName") String loginName,
|
@Param("loginName") String loginName,
|
||||||
@Param("type") String type,
|
@Param("type") String type,
|
||||||
@Param("enabled") String enabled);
|
@Param("enabled") String enabled,
|
||||||
|
@Param("remark") String remark);
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,8 @@ public class TenantComponent implements ICommonQuery {
|
|||||||
String loginName = StringUtil.getInfo(search, "loginName");
|
String loginName = StringUtil.getInfo(search, "loginName");
|
||||||
String type = StringUtil.getInfo(search, "type");
|
String type = StringUtil.getInfo(search, "type");
|
||||||
String enabled = StringUtil.getInfo(search, "enabled");
|
String enabled = StringUtil.getInfo(search, "enabled");
|
||||||
return tenantService.select(loginName, type, enabled, QueryUtils.offset(map), QueryUtils.rows(map));
|
String remark = StringUtil.getInfo(search, "remark");
|
||||||
|
return tenantService.select(loginName, type, enabled, remark, QueryUtils.offset(map), QueryUtils.rows(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -45,7 +46,8 @@ public class TenantComponent implements ICommonQuery {
|
|||||||
String loginName = StringUtil.getInfo(search, "loginName");
|
String loginName = StringUtil.getInfo(search, "loginName");
|
||||||
String type = StringUtil.getInfo(search, "type");
|
String type = StringUtil.getInfo(search, "type");
|
||||||
String enabled = StringUtil.getInfo(search, "enabled");
|
String enabled = StringUtil.getInfo(search, "enabled");
|
||||||
return tenantService.countTenant(loginName, type, enabled);
|
String remark = StringUtil.getInfo(search, "remark");
|
||||||
|
return tenantService.countTenant(loginName, type, enabled, remark);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -71,11 +71,11 @@ public class TenantService {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TenantEx> select(String loginName, String type, String enabled, int offset, int rows)throws Exception {
|
public List<TenantEx> select(String loginName, String type, String enabled, String remark, int offset, int rows)throws Exception {
|
||||||
List<TenantEx> list= new ArrayList<>();
|
List<TenantEx> list= new ArrayList<>();
|
||||||
try{
|
try{
|
||||||
if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) {
|
if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) {
|
||||||
list = tenantMapperEx.selectByConditionTenant(loginName, type, enabled, offset, rows);
|
list = tenantMapperEx.selectByConditionTenant(loginName, type, enabled, remark, offset, rows);
|
||||||
if (null != list) {
|
if (null != list) {
|
||||||
for (TenantEx tenantEx : list) {
|
for (TenantEx tenantEx : list) {
|
||||||
tenantEx.setCreateTimeStr(Tools.getCenternTime(tenantEx.getCreateTime()));
|
tenantEx.setCreateTimeStr(Tools.getCenternTime(tenantEx.getCreateTime()));
|
||||||
@@ -89,11 +89,11 @@ public class TenantService {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long countTenant(String loginName, String type, String enabled)throws Exception {
|
public Long countTenant(String loginName, String type, String enabled, String remark)throws Exception {
|
||||||
Long result=null;
|
Long result=null;
|
||||||
try{
|
try{
|
||||||
if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) {
|
if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) {
|
||||||
result = tenantMapperEx.countsByTenant(loginName, type, enabled);
|
result = tenantMapperEx.countsByTenant(loginName, type, enabled, remark);
|
||||||
}
|
}
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
<if test="enabled != null and enabled != ''">
|
<if test="enabled != null and enabled != ''">
|
||||||
and enabled = #{enabled}
|
and enabled = #{enabled}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||||
|
and remark like #{bindRemark}
|
||||||
|
</if>
|
||||||
order by id desc
|
order by id desc
|
||||||
<if test="offset != null and rows != null">
|
<if test="offset != null and rows != null">
|
||||||
limit #{offset},#{rows}
|
limit #{offset},#{rows}
|
||||||
@@ -41,5 +45,9 @@
|
|||||||
<if test="enabled != null and enabled != ''">
|
<if test="enabled != null and enabled != ''">
|
||||||
and enabled = #{enabled}
|
and enabled = #{enabled}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
<bind name="bindRemark" value="'%'+remark+'%'"/>
|
||||||
|
and remark like #{bindRemark}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user