Search in sources :

Example 11 with EnterpriseExample

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

the class BillServiceImpl method getEnterpriseMapByUserInfoId.

/**
 * 根据用户id查询订单表中对应的企业Map
 *
 * @param userInfo
 * @return
 */
public Map<Long, Enterprise> getEnterpriseMapByUserInfoId(Long userInfo) {
    Map<Long, Enterprise> enterpriseMap = new HashMap<Long, Enterprise>();
    List<Long> enterpriseIds = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectEnterprisesByUserInfo", userInfo);
    if (null != enterpriseIds && !enterpriseIds.isEmpty()) {
        EnterpriseExample example = new EnterpriseExample();
        EnterpriseExample.Criteria criteria = example.or();
        criteria.andIdIn(enterpriseIds);
        enterpriseMap = sqlSession.selectMap("com.itrus.portal.db.EnterpriseMapper.selectByExample", example, "id");
    }
    return enterpriseMap;
}
Also used : EnterpriseExample(com.itrus.portal.db.EnterpriseExample) HashMap(java.util.HashMap) Enterprise(com.itrus.portal.db.Enterprise)

Aggregations

EnterpriseExample (com.itrus.portal.db.EnterpriseExample)11 Enterprise (com.itrus.portal.db.Enterprise)10 HashMap (java.util.HashMap)3 Bill (com.itrus.portal.db.Bill)2 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 Agent (com.itrus.portal.db.Agent)1 BillExample (com.itrus.portal.db.BillExample)1 Certification (com.itrus.portal.db.Certification)1 Product (com.itrus.portal.db.Product)1 Project (com.itrus.portal.db.Project)1 UserInfo (com.itrus.portal.db.UserInfo)1 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)1 Calendar (java.util.Calendar)1 List (java.util.List)1 Map (java.util.Map)1