Search in sources :

Example 1 with SysConfigExample

use of com.itrus.portal.db.SysConfigExample in project portal by ixinportal.

the class SysConfigController method list.

// 列表所有信息
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) {
    SysConfigExample sysconfigex = new SysConfigExample();
    // sysconfigex.or().andIdIsNotNull();
    List sysconfigall = sqlSession.selectList("com.itrus.portal.db.SysConfigMapper.selectByExample", sysconfigex);
    uiModel.addAttribute("sysconfigs", sysconfigall);
    List<String> sysConfigList = sqlSession.selectList("com.itrus.portal.db.SysConfigMapper.selectTypes");
    uiModel.addAttribute("sflit", sysConfigList);
    return "sysconfigs/list";
}
Also used : SysConfigExample(com.itrus.portal.db.SysConfigExample) List(java.util.List) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with SysConfigExample

use of com.itrus.portal.db.SysConfigExample in project portal by ixinportal.

the class GetRaInfoTask method isSyncGetRa.

/**
 * true表示可以往下执行,false表示不能继续往下执行
 *
 * @return
 */
public boolean isSyncGetRa() {
    SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
    String timeStr = format.format(new Date());
    String random = getRandomStr();
    String syncRaInfo = timeStr + "_" + random;
    SysConfig conf = new SysConfig();
    conf.setConfig(syncRaInfo);
    Map<String, Object> retmap = new HashMap<String, Object>();
    retmap.put("record", conf);
    SysConfigExample example = new SysConfigExample();
    SysConfigExample.Criteria criteria = example.or();
    criteria.andTypeEqualTo("syncRaInfo");
    criteria.andConfigNotLike(timeStr + "_%");
    retmap.put("example", example);
    sqlSession.update("com.itrus.portal.db.SysConfigMapper.updateByExampleSelective", retmap);
    example = new SysConfigExample();
    criteria = example.or();
    criteria.andTypeEqualTo("syncRaInfo");
    criteria.andConfigEqualTo(syncRaInfo);
    SysConfig config = sqlSession.selectOne("com.itrus.portal.db.SysConfigMapper.selectByExample", example);
    if (null == config) {
        return false;
    } else {
        return true;
    }
}
Also used : SysConfig(com.itrus.portal.db.SysConfig) HashMap(java.util.HashMap) SysConfigExample(com.itrus.portal.db.SysConfigExample) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Aggregations

SysConfigExample (com.itrus.portal.db.SysConfigExample)2 SysConfig (com.itrus.portal.db.SysConfig)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 List (java.util.List)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1