Browse Source

单位列表

gaodd 1 year ago
parent
commit
c46f075b58

+ 12 - 7
src/main/java/com/chinaitop/depot/system/controller/UnitInfoController.java

@@ -13,11 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
13 13
 import org.springframework.web.bind.annotation.RestController;
14 14
 
15 15
 import com.chinaitop.depot.system.model.BizUnitInfo;
16
-import com.chinaitop.depot.system.model.UserRole;
17
-import com.chinaitop.depot.system.model.UserRoleExample;
18
-import com.chinaitop.depot.system.model.UserRoleExample.Criteria;
19 16
 import com.chinaitop.depot.system.service.UnitInfoService;
20
-import com.chinaitop.depot.system.service.UserRoleService;
21 17
 import com.github.pagehelper.PageInfo;
22 18
 
23 19
 import io.swagger.annotations.Api;
@@ -27,8 +23,6 @@ import io.swagger.annotations.ApiOperation;
27 23
 
28 24
 /**
29 25
  * 单位信息控制类
30
- * @author shine
31
- * 
32 26
  * 查询省平台数据库
33 27
  *
34 28
  */
@@ -63,7 +57,7 @@ public class UnitInfoController {
63 57
     }
64 58
 
65 59
     /**
66
-     * 单位信息下拉
60
+     * 单位信息下拉 查询单位类型
67 61
 
68 62
      * @return
69 63
 
@@ -112,6 +106,17 @@ public class UnitInfoController {
112 106
 
113 107
     }
114 108
 	
109
+    /**
110
+     * 
111
+     * 获取所有单位信息
112
+     * @return
113
+     */
114
+    @RequestMapping(value="/getAllUnitInfo",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
115
+    @ApiOperation(value="单位列表", notes = "查询数据无分页")
116
+    public List<BizUnitInfo> getAllUnitInfo() {
117
+
118
+        return unitInfoService.getAllUnitInfo();
119
+    }
115 120
 	
116 121
 
117 122
 }

+ 2 - 0
src/main/java/com/chinaitop/depot/system/mapper/BizUnitInfoMapper.java

@@ -31,4 +31,6 @@ public interface BizUnitInfoMapper {
31 31
     int updateByPrimaryKeySelective(BizUnitInfo record);
32 32
 
33 33
     int updateByPrimaryKey(BizUnitInfo record);
34
+
35
+	List<BizUnitInfo> selectByExampleOriginal(BizUnitInfoExample example);
34 36
 }

+ 15 - 0
src/main/java/com/chinaitop/depot/system/mapper/BizUnitInfoMapper.xml

@@ -125,6 +125,21 @@
125 125
     </if>
126 126
   </select>
127 127
 
128
+ <select id="selectByExampleOriginal" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.system.model.BizUnitInfoExample" >
129
+    select
130
+    <if test="distinct">
131
+      distinct
132
+    </if>
133
+    <include refid="Base_Column_List" />
134
+    from province_all.biz_unit_info bui
135
+    <if test="_parameter != null">
136
+      <include refid="Example_Where_Clause" />
137
+    </if>
138
+    <if test="orderByClause != null">
139
+      order by ${orderByClause}
140
+    </if>
141
+  </select>
142
+  
128 143
   <select id="TreeList" resultMap="BaseResultMap">
129 144
     select
130 145
     <if test="distinct" >

+ 2 - 0
src/main/java/com/chinaitop/depot/system/service/UnitInfoService.java

@@ -13,6 +13,8 @@ public interface UnitInfoService {
13 13
 	BizUnitInfo getById(String id);
14 14
 
15 15
 	BizUnitInfo getOrg(String dwdm);
16
+
17
+	List<BizUnitInfo> getAllUnitInfo();
16 18
 	
17 19
 	
18 20
 

+ 18 - 2
src/main/java/com/chinaitop/depot/system/service/impl/UnitInfoServiceImpl.java

@@ -5,6 +5,7 @@ import com.chinaitop.depot.system.model.BizUnitInfoExample;
5 5
 import com.chinaitop.depot.system.model.BizUnitInfoExample.Criteria;
6 6
 import com.chinaitop.depot.system.service.UnitInfoService;
7 7
 import com.github.pagehelper.PageHelper;
8
+import com.github.pagehelper.PageInfo;
8 9
 
9 10
 import org.apache.commons.lang.StringUtils;
10 11
 import org.springframework.stereotype.Service;
@@ -25,6 +26,8 @@ public class UnitInfoServiceImpl implements UnitInfoService {
25 26
 		    BizUnitInfoExample example = new BizUnitInfoExample();
26 27
 	        Criteria createCriteria = example.createCriteria();
27 28
 	        
29
+	        createCriteria.andDeleteFlagEqualTo("NOT_DELETE");
30
+	        
28 31
 	        if(StringUtils.isNotBlank(unitInfoId)){
29 32
 	        	createCriteria.andIdEqualTo(unitInfoId);
30 33
 	        }
@@ -40,8 +43,11 @@ public class UnitInfoServiceImpl implements UnitInfoService {
40 43
 	        }
41 44
 	        
42 45
 	        example.setOrderByClause("create_time desc");
43
-	      
44
-	        PageHelper.startPage(pageNum, pageSize);
46
+	        
47
+	       if(pageNum != null && pageSize != null){
48
+		        PageHelper.startPage(pageNum, pageSize);
49
+
50
+	       }
45 51
 	        
46 52
 	        List<BizUnitInfo> selectByExample = unitInfoMapper.selectByExample(example);
47 53
 	        return selectByExample;
@@ -67,6 +73,16 @@ public class UnitInfoServiceImpl implements UnitInfoService {
67 73
 		return unitInfoMapper.getOrg(dwdm);
68 74
 	}
69 75
 
76
+	
77
+	@Override
78
+	public List<BizUnitInfo> getAllUnitInfo() {
79
+		// TODO Auto-generated method stub
80
+		BizUnitInfoExample example = new BizUnitInfoExample();
81
+        Criteria createCriteria = example.createCriteria();
82
+        createCriteria.andDeleteFlagEqualTo("NOT_DELETE");
83
+		return unitInfoMapper.selectByExampleOriginal(example);
84
+	}
85
+
70 86
 
71 87
 
72 88
 }