| | |
| | | package cn.ksource.web.facade.customerconfig.slacustomer; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import cn.ksource.beans.CI_DAILY_PATROL_ITEM; |
| | | import cn.ksource.beans.CMDB_CI_CATEGORY; |
| | | import cn.ksource.core.dao.BaseDao; |
| | |
| | | import cn.ksource.core.util.ConvertUtil; |
| | | import cn.ksource.core.util.JsonUtil; |
| | | import cn.ksource.core.util.StringUtil; |
| | | import cn.ksource.core.web.WebUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | @Service("slaCustomerFacade") |
| | | public class SlaCustomerFacadeImpl implements SlaCustomerFacade{ |
| | | @Autowired |
| | |
| | | */ |
| | | @Override |
| | | public List<Map> getCiCategoryTree(String pid,String type) { |
| | | String sql = " SELECT ID as id,PID as pid,NAME as name,LV as jb,STATE,SERIAL FROM CMDB_CI_CATEGORY WHERE STATE=1 "; |
| | | String sql = " SELECT ID as id,PID as pid,NAME as \"name\",LV as jb,STATE,SERIAL FROM CMDB_CI_CATEGORY WHERE STATE=1 "; |
| | | SqlParameter param = new SqlParameter(); |
| | | if(StringUtil.notEmpty(type)){ |
| | | sql+=" and cate_type=:type"; |
| | |
| | | sql=""; |
| | | sql="select DISTINCT LV1_ID AS id,\n" + |
| | | " '0' AS pid ,\n" + |
| | | " LV1_name AS name,\n" + |
| | | " LV1_name AS \"name\",\n" + |
| | | " '1' AS lv,STATE,SERIAL from CMDB_CI_CATEGORY where STATE=1 and lv=3 and CATE_TYPE=2 "; |
| | | }else if(StringUtil.isNotBlank(pid) && type.equals("2")){ |
| | | CMDB_CI_CATEGORY cmdb_ci_category=new CMDB_CI_CATEGORY(pid).getInstanceById(); |
| | |
| | | sql=""; |
| | | sql="select DISTINCT LV1_ID AS id,\n" + |
| | | " '0' AS pid ,\n" + |
| | | " LV1_name AS name,\n" + |
| | | " LV1_name AS \"name\",\n" + |
| | | " '1' AS lv,STATE,SERIAL from CMDB_CI_CATEGORY where STATE=1 and lv=3 and CATE_TYPE=2 and LV1_ID=:pid "; |
| | | param.addValue("pid", pid); |
| | | } |