|
|
|
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 t.delete_type ='0' ";
|
|
|
|
String name = (String) params.get("levelName");
|
|
|
|
if (StringUtils.isNotBlank(name)) {
|
|
|
|
sqlWhere += " AND t.level_name " + dbType.like(name);
|
|
|
|
}
|
|
|
|
String no = (String) params.get("levelNo");
|
|
|
|
if (StringUtils.isNotBlank(no)) {
|
|
|
|
sqlWhere += " AND t.level_no " + dbType.like(no);
|
|
|
|
}
|
|
|
|
return sqlWhere;
|
|
|
|
}
|
|
|
|
}
|