@Override
public Map<String,Object> getCgjlcgqxzjg(String orders, String CompName, int page, int rows) {
HashMap<String, Object> hashMap = new HashMap<>();
StringBuffer sql=null;
if (CompName.equals("653")) {
sql = new StringBuffer(" JJKJ_CGJLCGQXZJG a LEFT JOIN JJKJ_HBJCZBA h ON h.jczbh= a.jyjgbh LEFT JOIN JJKJ_HBSBBA d ON a.jcsbbh = d.jcsbbh where 1=1 ");
}else {
sql = new StringBuffer(" JJKJ_CGJLCGQXZJG a LEFT JOIN JJKJ_HBJCZBA h ON h.jczbh= a.jyjgbh LEFT JOIN JJKJ_HBSBBA d ON a.jcsbbh = d.jcsbbh where 1=1 and a.jyjgbh='"+CompName+"'");
}
if (orders!=null){
sql.append(orders);
}
// sql.append("ORDER BY a.JZKSSJ DESC");
int total = jdbcTemplate.queryForObject("select count(*) from "+sql.toString(),Integer.class);
String sqls = "select top "+rows+" * from "+sql.toString()+"and CGJLCGQXZJGID not in (select top "+(page-1)*rows+" CGJLCGQXZJGID from JJKJ_CGJLCGQXZJG)";
List<JjkjCgjlcgqxzjg1> list = jdbcTemplate.query(sqls, new BeanPropertyRowMapper(JjkjCgjlcgqxzjg1.class));
hashMap.put("total",total);
hashMap.put("rows",list);
return hashMap;
}