| | |
| | | package com.moral.service.impl;
|
| | |
|
| | | import com.github.pagehelper.PageHelper;
|
| | | import com.moral.common.bean.Constants;
|
| | | import com.moral.common.bean.PageBean;
|
| | | import com.moral.common.util.ExampleUtil;
|
| | | import com.moral.common.util.MyBatisBaseMapUtil;
|
| | | import com.moral.common.util.ValidateUtil;
|
| | | import com.moral.entity.Organization;
|
| | | import com.moral.entity.exp.OrganizationExp;
|
| | |
| | | import com.moral.service.OrganizationService;
|
| | | import org.springframework.stereotype.Service;
|
| | | import tk.mybatis.mapper.entity.Example;
|
| | | import tk.mybatis.mapper.mapperhelper.SqlHelper;
|
| | | import tk.mybatis.mapper.entity.Example.Criteria;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import java.util.*;
|
| | |
| | |
|
| | | public PageBean queryByPageBean(PageBean pageBean){
|
| | | Example example = ExampleUtil.generateExample(ENTITY_CLASS,pageBean);
|
| | | //me
|
| | | List<Example.Criteria> criteriaList = example.getOredCriteria();
|
| | | if(criteriaList!=null&&criteriaList.size()>0){
|
| | | for(Example.Criteria cri : criteriaList){
|
| | |
| | | example.or().andNotEqualTo("isDelete","1");
|
| | | }
|
| | | PageHelper.startPage(pageBean.getPageIndex(),pageBean.getPageSize());
|
| | | List page = organizationMapper.selectWithAreaNameByExample(example);
|
| | | return new PageBean(page);
|
| | | List<OrganizationExp> organizationExpandList = organizationMapper.selectWithAreaNameByExample(example);
|
| | | return new PageBean(organizationExpandList);
|
| | | }
|
| | | public void addOrModify(Organization organization){
|
| | | try{
|
| | |
| | |
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<Organization> getOrganizationsByName(String name) {
|
| | | Example example = new Example(Organization.class);
|
| | | Criteria criteria = example.createCriteria();
|
| | | criteria.andLike("name", "%" + name + "%");
|
| | | criteria.andEqualTo("isDelete", Constants.IS_DELETE_FALSE);
|
| | | List<Organization> organizations = organizationMapper.selectByExample(example);
|
| | | return organizations;
|
| | | }
|
| | |
|
| | | }
|