You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.8 KiB
Java
57 lines
1.8 KiB
Java
3 years ago
|
package com.engine.organization.service.impl;
|
||
|
|
||
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
||
|
import com.engine.core.impl.Service;
|
||
|
import com.engine.organization.component.OrganizationWeaTable;
|
||
|
import com.engine.organization.entity.scheme.vo.LevelTableVO;
|
||
|
import com.engine.organization.entity.scheme.vo.SchemeTableVO;
|
||
|
import com.engine.organization.service.LevelService;
|
||
|
import com.engine.organization.util.db.DBType;
|
||
|
import com.weaverboot.frame.ioc.anno.classAnno.WeaIocService;
|
||
|
import org.apache.commons.lang3.StringUtils;
|
||
|
import weaver.conn.RecordSet;
|
||
|
|
||
|
import java.util.Map;
|
||
|
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @description: TODO
|
||
|
* @author:dxfeng
|
||
|
* @createTime: 2022/05/10
|
||
|
* @version: 1.0
|
||
|
*/
|
||
|
@WeaIocService
|
||
|
public class LevelServiceImpl extends Service implements LevelService {
|
||
|
@Override
|
||
|
public Map<String, Object> listPage(Map<String, Object> params) {
|
||
|
OrganizationWeaTable<SchemeTableVO> table = new OrganizationWeaTable<>(user, LevelTableVO.class);
|
||
|
String sqlWhere = buildSqlWhere(params);
|
||
|
table.setSqlwhere(sqlWhere);
|
||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||
|
result.putAll(table.makeDataResult());
|
||
|
result.success();
|
||
|
return result.getResultMap();
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 查询条件
|
||
|
*
|
||
|
* @param params
|
||
|
* @return
|
||
|
*/
|
||
|
private String buildSqlWhere(Map<String, Object> params) {
|
||
|
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||
|
String sqlWhere = " where delete_type ='0' ";
|
||
|
String name = (String) params.get("name");
|
||
|
if (StringUtils.isNotBlank(name)) {
|
||
|
sqlWhere += " AND scheme_name " + dbType.like(name);
|
||
|
}
|
||
|
String no = (String) params.get("no");
|
||
|
if (StringUtils.isNotBlank(no)) {
|
||
|
sqlWhere += " AND scheme_no " + dbType.like(no);
|
||
|
}
|
||
|
return sqlWhere;
|
||
|
}
|
||
|
}
|