Browse Source

pad端安装文件下载地址接口开发

fanxw 2 years ago
parent
commit
db14b527d0

+ 39 - 0
src/main/java/com/chinaitop/depot/system/controller/SysCodeController.java

@@ -0,0 +1,39 @@
1
+package com.chinaitop.depot.system.controller;
2
+
3
+import javax.annotation.Resource;
4
+
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RequestMethod;
7
+import org.springframework.web.bind.annotation.RestController;
8
+
9
+import com.chinaitop.depot.system.service.SysCodeService;
10
+
11
+import io.swagger.annotations.Api;
12
+import io.swagger.annotations.ApiImplicitParam;
13
+import io.swagger.annotations.ApiImplicitParams;
14
+import io.swagger.annotations.ApiOperation;
15
+
16
+@RequestMapping(value="/system/syscode")
17
+@RestController
18
+@Api(description = "系统配置表控制类")
19
+public class SysCodeController {
20
+
21
+	@Resource
22
+	private SysCodeService sysCodeService;
23
+
24
+	@RequestMapping(value="/getPadUrl", method = RequestMethod.POST)
25
+	@ApiOperation(value="获取一条基础配置数据的val", notes = "")
26
+	@ApiImplicitParams({
27
+			@ApiImplicitParam(name = "orgId", value = "组织机构ID", paramType = "form"),
28
+			@ApiImplicitParam(name = "code", value = "配置数据的标志符", paramType = "form")
29
+	})
30
+	public String getPadUrl(Integer orgId, String code) {
31
+		String path = "";
32
+		try {
33
+			path = sysCodeService.getSVal(orgId, code);
34
+		} catch (Exception e) {
35
+			path = "系统异常,请联系管理员";
36
+		}
37
+		return path;
38
+	}
39
+}

+ 31 - 0
src/main/java/com/chinaitop/depot/system/mapper/SysCodeMapper.java

@@ -0,0 +1,31 @@
1
+package com.chinaitop.depot.system.mapper;
2
+
3
+import com.chinaitop.depot.system.model.SysCode;
4
+import com.chinaitop.depot.system.model.SysCodeExample;
5
+import com.chinaitop.depot.system.model.SysCodeKey;
6
+import java.util.List;
7
+import org.apache.ibatis.annotations.Param;
8
+
9
+public interface SysCodeMapper {
10
+    int countByExample(SysCodeExample example);
11
+
12
+    int deleteByExample(SysCodeExample example);
13
+
14
+    int deleteByPrimaryKey(SysCodeKey key);
15
+
16
+    int insert(SysCode record);
17
+
18
+    int insertSelective(SysCode record);
19
+
20
+    List<SysCode> selectByExample(SysCodeExample example);
21
+
22
+    SysCode selectByPrimaryKey(SysCodeKey key);
23
+
24
+    int updateByExampleSelective(@Param("record") SysCode record, @Param("example") SysCodeExample example);
25
+
26
+    int updateByExample(@Param("record") SysCode record, @Param("example") SysCodeExample example);
27
+
28
+    int updateByPrimaryKeySelective(SysCode record);
29
+
30
+    int updateByPrimaryKey(SysCode record);
31
+}

+ 196 - 0
src/main/java/com/chinaitop/depot/system/mapper/SysCodeMapper.xml

@@ -0,0 +1,196 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.system.mapper.SysCodeMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.system.model.SysCode" >
5
+    <id column="org_id" property="orgId" jdbcType="INTEGER" />
6
+    <id column="s_code" property="sCode" jdbcType="VARCHAR" />
7
+    <result column="s_val" property="sVal" jdbcType="VARCHAR" />
8
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
9
+  </resultMap>
10
+  <sql id="Example_Where_Clause" >
11
+    <where >
12
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
13
+        <if test="criteria.valid" >
14
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
15
+            <foreach collection="criteria.criteria" item="criterion" >
16
+              <choose >
17
+                <when test="criterion.noValue" >
18
+                  and ${criterion.condition}
19
+                </when>
20
+                <when test="criterion.singleValue" >
21
+                  and ${criterion.condition} #{criterion.value}
22
+                </when>
23
+                <when test="criterion.betweenValue" >
24
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
25
+                </when>
26
+                <when test="criterion.listValue" >
27
+                  and ${criterion.condition}
28
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
29
+                    #{listItem}
30
+                  </foreach>
31
+                </when>
32
+              </choose>
33
+            </foreach>
34
+          </trim>
35
+        </if>
36
+      </foreach>
37
+    </where>
38
+  </sql>
39
+  <sql id="Update_By_Example_Where_Clause" >
40
+    <where >
41
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
42
+        <if test="criteria.valid" >
43
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
44
+            <foreach collection="criteria.criteria" item="criterion" >
45
+              <choose >
46
+                <when test="criterion.noValue" >
47
+                  and ${criterion.condition}
48
+                </when>
49
+                <when test="criterion.singleValue" >
50
+                  and ${criterion.condition} #{criterion.value}
51
+                </when>
52
+                <when test="criterion.betweenValue" >
53
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
54
+                </when>
55
+                <when test="criterion.listValue" >
56
+                  and ${criterion.condition}
57
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
58
+                    #{listItem}
59
+                  </foreach>
60
+                </when>
61
+              </choose>
62
+            </foreach>
63
+          </trim>
64
+        </if>
65
+      </foreach>
66
+    </where>
67
+  </sql>
68
+  <sql id="Base_Column_List" >
69
+    org_id, s_code, s_val, updatetime
70
+  </sql>
71
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.system.model.SysCodeExample" >
72
+    select
73
+    <if test="distinct" >
74
+      distinct
75
+    </if>
76
+    <include refid="Base_Column_List" />
77
+    from sys_code
78
+    <if test="_parameter != null" >
79
+      <include refid="Example_Where_Clause" />
80
+    </if>
81
+    <if test="orderByClause != null" >
82
+      order by ${orderByClause}
83
+    </if>
84
+  </select>
85
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.system.model.SysCodeKey" >
86
+    select 
87
+    <include refid="Base_Column_List" />
88
+    from sys_code
89
+    where org_id = #{orgId,jdbcType=INTEGER}
90
+      and s_code = #{sCode,jdbcType=VARCHAR}
91
+  </select>
92
+  <delete id="deleteByPrimaryKey" parameterType="com.chinaitop.depot.system.model.SysCodeKey" >
93
+    delete from sys_code
94
+    where org_id = #{orgId,jdbcType=INTEGER}
95
+      and s_code = #{sCode,jdbcType=VARCHAR}
96
+  </delete>
97
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.system.model.SysCodeExample" >
98
+    delete from sys_code
99
+    <if test="_parameter != null" >
100
+      <include refid="Example_Where_Clause" />
101
+    </if>
102
+  </delete>
103
+  <insert id="insert" parameterType="com.chinaitop.depot.system.model.SysCode" >
104
+    insert into sys_code (org_id, s_code, s_val, 
105
+      updatetime)
106
+    values (#{orgId,jdbcType=INTEGER}, #{sCode,jdbcType=VARCHAR}, #{sVal,jdbcType=VARCHAR}, 
107
+      #{updatetime,jdbcType=TIMESTAMP})
108
+  </insert>
109
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.system.model.SysCode" >
110
+    insert into sys_code
111
+    <trim prefix="(" suffix=")" suffixOverrides="," >
112
+      <if test="orgId != null" >
113
+        org_id,
114
+      </if>
115
+      <if test="sCode != null" >
116
+        s_code,
117
+      </if>
118
+      <if test="sVal != null" >
119
+        s_val,
120
+      </if>
121
+      <if test="updatetime != null" >
122
+        updatetime,
123
+      </if>
124
+    </trim>
125
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
126
+      <if test="orgId != null" >
127
+        #{orgId,jdbcType=INTEGER},
128
+      </if>
129
+      <if test="sCode != null" >
130
+        #{sCode,jdbcType=VARCHAR},
131
+      </if>
132
+      <if test="sVal != null" >
133
+        #{sVal,jdbcType=VARCHAR},
134
+      </if>
135
+      <if test="updatetime != null" >
136
+        #{updatetime,jdbcType=TIMESTAMP},
137
+      </if>
138
+    </trim>
139
+  </insert>
140
+  <select id="countByExample" parameterType="com.chinaitop.depot.system.model.SysCodeExample" resultType="java.lang.Integer" >
141
+    select count(*) from sys_code
142
+    <if test="_parameter != null" >
143
+      <include refid="Example_Where_Clause" />
144
+    </if>
145
+  </select>
146
+  <update id="updateByExampleSelective" parameterType="map" >
147
+    update sys_code
148
+    <set >
149
+      <if test="record.orgId != null" >
150
+        org_id = #{record.orgId,jdbcType=INTEGER},
151
+      </if>
152
+      <if test="record.sCode != null" >
153
+        s_code = #{record.sCode,jdbcType=VARCHAR},
154
+      </if>
155
+      <if test="record.sVal != null" >
156
+        s_val = #{record.sVal,jdbcType=VARCHAR},
157
+      </if>
158
+      <if test="record.updatetime != null" >
159
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
160
+      </if>
161
+    </set>
162
+    <if test="_parameter != null" >
163
+      <include refid="Update_By_Example_Where_Clause" />
164
+    </if>
165
+  </update>
166
+  <update id="updateByExample" parameterType="map" >
167
+    update sys_code
168
+    set org_id = #{record.orgId,jdbcType=INTEGER},
169
+      s_code = #{record.sCode,jdbcType=VARCHAR},
170
+      s_val = #{record.sVal,jdbcType=VARCHAR},
171
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
172
+    <if test="_parameter != null" >
173
+      <include refid="Update_By_Example_Where_Clause" />
174
+    </if>
175
+  </update>
176
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.system.model.SysCode" >
177
+    update sys_code
178
+    <set >
179
+      <if test="sVal != null" >
180
+        s_val = #{sVal,jdbcType=VARCHAR},
181
+      </if>
182
+      <if test="updatetime != null" >
183
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
184
+      </if>
185
+    </set>
186
+    where org_id = #{orgId,jdbcType=INTEGER}
187
+      and s_code = #{sCode,jdbcType=VARCHAR}
188
+  </update>
189
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.system.model.SysCode" >
190
+    update sys_code
191
+    set s_val = #{sVal,jdbcType=VARCHAR},
192
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
193
+    where org_id = #{orgId,jdbcType=INTEGER}
194
+      and s_code = #{sCode,jdbcType=VARCHAR}
195
+  </update>
196
+</mapper>

+ 41 - 0
src/main/java/com/chinaitop/depot/system/model/SysCode.java

@@ -0,0 +1,41 @@
1
+package com.chinaitop.depot.system.model;
2
+
3
+import java.util.Date;
4
+
5
+public class SysCode extends SysCodeKey {
6
+    private String sVal;
7
+
8
+    private Date updatetime;
9
+
10
+    public SysCode() {
11
+        super();
12
+    }
13
+
14
+    public SysCode(int orgId, String sCode) {
15
+        super(orgId, sCode);
16
+    }
17
+
18
+    /**
19
+     * 配置内容
20
+     * @return
21
+     */
22
+    public String getsVal() {
23
+        return sVal;
24
+    }
25
+
26
+    /**
27
+     * 配置内容
28
+     * @param sVal
29
+     */
30
+    public void setsVal(String sVal) {
31
+        this.sVal = sVal == null ? null : sVal.trim();
32
+    }
33
+
34
+    public Date getUpdatetime() {
35
+        return updatetime;
36
+    }
37
+
38
+    public void setUpdatetime(Date updatetime) {
39
+        this.updatetime = updatetime;
40
+    }
41
+}

+ 461 - 0
src/main/java/com/chinaitop/depot/system/model/SysCodeExample.java

@@ -0,0 +1,461 @@
1
+package com.chinaitop.depot.system.model;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.List;
6
+
7
+public class SysCodeExample {
8
+    protected String orderByClause;
9
+
10
+    protected boolean distinct;
11
+
12
+    protected List<Criteria> oredCriteria;
13
+
14
+    public SysCodeExample() {
15
+        oredCriteria = new ArrayList<Criteria>();
16
+    }
17
+
18
+    public void setOrderByClause(String orderByClause) {
19
+        this.orderByClause = orderByClause;
20
+    }
21
+
22
+    public String getOrderByClause() {
23
+        return orderByClause;
24
+    }
25
+
26
+    public void setDistinct(boolean distinct) {
27
+        this.distinct = distinct;
28
+    }
29
+
30
+    public boolean isDistinct() {
31
+        return distinct;
32
+    }
33
+
34
+    public List<Criteria> getOredCriteria() {
35
+        return oredCriteria;
36
+    }
37
+
38
+    public void or(Criteria criteria) {
39
+        oredCriteria.add(criteria);
40
+    }
41
+
42
+    public Criteria or() {
43
+        Criteria criteria = createCriteriaInternal();
44
+        oredCriteria.add(criteria);
45
+        return criteria;
46
+    }
47
+
48
+    public Criteria createCriteria() {
49
+        Criteria criteria = createCriteriaInternal();
50
+        if (oredCriteria.size() == 0) {
51
+            oredCriteria.add(criteria);
52
+        }
53
+        return criteria;
54
+    }
55
+
56
+    protected Criteria createCriteriaInternal() {
57
+        Criteria criteria = new Criteria();
58
+        return criteria;
59
+    }
60
+
61
+    public void clear() {
62
+        oredCriteria.clear();
63
+        orderByClause = null;
64
+        distinct = false;
65
+    }
66
+
67
+    protected abstract static class GeneratedCriteria {
68
+        protected List<Criterion> criteria;
69
+
70
+        protected GeneratedCriteria() {
71
+            super();
72
+            criteria = new ArrayList<Criterion>();
73
+        }
74
+
75
+        public boolean isValid() {
76
+            return criteria.size() > 0;
77
+        }
78
+
79
+        public List<Criterion> getAllCriteria() {
80
+            return criteria;
81
+        }
82
+
83
+        public List<Criterion> getCriteria() {
84
+            return criteria;
85
+        }
86
+
87
+        protected void addCriterion(String condition) {
88
+            if (condition == null) {
89
+                throw new RuntimeException("Value for condition cannot be null");
90
+            }
91
+            criteria.add(new Criterion(condition));
92
+        }
93
+
94
+        protected void addCriterion(String condition, Object value, String property) {
95
+            if (value == null) {
96
+                throw new RuntimeException("Value for " + property + " cannot be null");
97
+            }
98
+            criteria.add(new Criterion(condition, value));
99
+        }
100
+
101
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
102
+            if (value1 == null || value2 == null) {
103
+                throw new RuntimeException("Between values for " + property + " cannot be null");
104
+            }
105
+            criteria.add(new Criterion(condition, value1, value2));
106
+        }
107
+
108
+        public Criteria andOrgIdIsNull() {
109
+            addCriterion("org_id is null");
110
+            return (Criteria) this;
111
+        }
112
+
113
+        public Criteria andOrgIdIsNotNull() {
114
+            addCriterion("org_id is not null");
115
+            return (Criteria) this;
116
+        }
117
+
118
+        public Criteria andOrgIdEqualTo(Integer value) {
119
+            addCriterion("org_id =", value, "orgId");
120
+            return (Criteria) this;
121
+        }
122
+
123
+        public Criteria andOrgIdNotEqualTo(Integer value) {
124
+            addCriterion("org_id <>", value, "orgId");
125
+            return (Criteria) this;
126
+        }
127
+
128
+        public Criteria andOrgIdGreaterThan(Integer value) {
129
+            addCriterion("org_id >", value, "orgId");
130
+            return (Criteria) this;
131
+        }
132
+
133
+        public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
134
+            addCriterion("org_id >=", value, "orgId");
135
+            return (Criteria) this;
136
+        }
137
+
138
+        public Criteria andOrgIdLessThan(Integer value) {
139
+            addCriterion("org_id <", value, "orgId");
140
+            return (Criteria) this;
141
+        }
142
+
143
+        public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
144
+            addCriterion("org_id <=", value, "orgId");
145
+            return (Criteria) this;
146
+        }
147
+
148
+        public Criteria andOrgIdIn(List<Integer> values) {
149
+            addCriterion("org_id in", values, "orgId");
150
+            return (Criteria) this;
151
+        }
152
+
153
+        public Criteria andOrgIdNotIn(List<Integer> values) {
154
+            addCriterion("org_id not in", values, "orgId");
155
+            return (Criteria) this;
156
+        }
157
+
158
+        public Criteria andOrgIdBetween(Integer value1, Integer value2) {
159
+            addCriterion("org_id between", value1, value2, "orgId");
160
+            return (Criteria) this;
161
+        }
162
+
163
+        public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
164
+            addCriterion("org_id not between", value1, value2, "orgId");
165
+            return (Criteria) this;
166
+        }
167
+
168
+        public Criteria andSCodeIsNull() {
169
+            addCriterion("s_code is null");
170
+            return (Criteria) this;
171
+        }
172
+
173
+        public Criteria andSCodeIsNotNull() {
174
+            addCriterion("s_code is not null");
175
+            return (Criteria) this;
176
+        }
177
+
178
+        public Criteria andSCodeEqualTo(String value) {
179
+            addCriterion("s_code =", value, "sCode");
180
+            return (Criteria) this;
181
+        }
182
+
183
+        public Criteria andSCodeNotEqualTo(String value) {
184
+            addCriterion("s_code <>", value, "sCode");
185
+            return (Criteria) this;
186
+        }
187
+
188
+        public Criteria andSCodeGreaterThan(String value) {
189
+            addCriterion("s_code >", value, "sCode");
190
+            return (Criteria) this;
191
+        }
192
+
193
+        public Criteria andSCodeGreaterThanOrEqualTo(String value) {
194
+            addCriterion("s_code >=", value, "sCode");
195
+            return (Criteria) this;
196
+        }
197
+
198
+        public Criteria andSCodeLessThan(String value) {
199
+            addCriterion("s_code <", value, "sCode");
200
+            return (Criteria) this;
201
+        }
202
+
203
+        public Criteria andSCodeLessThanOrEqualTo(String value) {
204
+            addCriterion("s_code <=", value, "sCode");
205
+            return (Criteria) this;
206
+        }
207
+
208
+        public Criteria andSCodeLike(String value) {
209
+            addCriterion("s_code like", value, "sCode");
210
+            return (Criteria) this;
211
+        }
212
+
213
+        public Criteria andSCodeNotLike(String value) {
214
+            addCriterion("s_code not like", value, "sCode");
215
+            return (Criteria) this;
216
+        }
217
+
218
+        public Criteria andSCodeIn(List<String> values) {
219
+            addCriterion("s_code in", values, "sCode");
220
+            return (Criteria) this;
221
+        }
222
+
223
+        public Criteria andSCodeNotIn(List<String> values) {
224
+            addCriterion("s_code not in", values, "sCode");
225
+            return (Criteria) this;
226
+        }
227
+
228
+        public Criteria andSCodeBetween(String value1, String value2) {
229
+            addCriterion("s_code between", value1, value2, "sCode");
230
+            return (Criteria) this;
231
+        }
232
+
233
+        public Criteria andSCodeNotBetween(String value1, String value2) {
234
+            addCriterion("s_code not between", value1, value2, "sCode");
235
+            return (Criteria) this;
236
+        }
237
+
238
+        public Criteria andSValIsNull() {
239
+            addCriterion("s_val is null");
240
+            return (Criteria) this;
241
+        }
242
+
243
+        public Criteria andSValIsNotNull() {
244
+            addCriterion("s_val is not null");
245
+            return (Criteria) this;
246
+        }
247
+
248
+        public Criteria andSValEqualTo(String value) {
249
+            addCriterion("s_val =", value, "sVal");
250
+            return (Criteria) this;
251
+        }
252
+
253
+        public Criteria andSValNotEqualTo(String value) {
254
+            addCriterion("s_val <>", value, "sVal");
255
+            return (Criteria) this;
256
+        }
257
+
258
+        public Criteria andSValGreaterThan(String value) {
259
+            addCriterion("s_val >", value, "sVal");
260
+            return (Criteria) this;
261
+        }
262
+
263
+        public Criteria andSValGreaterThanOrEqualTo(String value) {
264
+            addCriterion("s_val >=", value, "sVal");
265
+            return (Criteria) this;
266
+        }
267
+
268
+        public Criteria andSValLessThan(String value) {
269
+            addCriterion("s_val <", value, "sVal");
270
+            return (Criteria) this;
271
+        }
272
+
273
+        public Criteria andSValLessThanOrEqualTo(String value) {
274
+            addCriterion("s_val <=", value, "sVal");
275
+            return (Criteria) this;
276
+        }
277
+
278
+        public Criteria andSValLike(String value) {
279
+            addCriterion("s_val like", value, "sVal");
280
+            return (Criteria) this;
281
+        }
282
+
283
+        public Criteria andSValNotLike(String value) {
284
+            addCriterion("s_val not like", value, "sVal");
285
+            return (Criteria) this;
286
+        }
287
+
288
+        public Criteria andSValIn(List<String> values) {
289
+            addCriterion("s_val in", values, "sVal");
290
+            return (Criteria) this;
291
+        }
292
+
293
+        public Criteria andSValNotIn(List<String> values) {
294
+            addCriterion("s_val not in", values, "sVal");
295
+            return (Criteria) this;
296
+        }
297
+
298
+        public Criteria andSValBetween(String value1, String value2) {
299
+            addCriterion("s_val between", value1, value2, "sVal");
300
+            return (Criteria) this;
301
+        }
302
+
303
+        public Criteria andSValNotBetween(String value1, String value2) {
304
+            addCriterion("s_val not between", value1, value2, "sVal");
305
+            return (Criteria) this;
306
+        }
307
+
308
+        public Criteria andUpdatetimeIsNull() {
309
+            addCriterion("updatetime is null");
310
+            return (Criteria) this;
311
+        }
312
+
313
+        public Criteria andUpdatetimeIsNotNull() {
314
+            addCriterion("updatetime is not null");
315
+            return (Criteria) this;
316
+        }
317
+
318
+        public Criteria andUpdatetimeEqualTo(Date value) {
319
+            addCriterion("updatetime =", value, "updatetime");
320
+            return (Criteria) this;
321
+        }
322
+
323
+        public Criteria andUpdatetimeNotEqualTo(Date value) {
324
+            addCriterion("updatetime <>", value, "updatetime");
325
+            return (Criteria) this;
326
+        }
327
+
328
+        public Criteria andUpdatetimeGreaterThan(Date value) {
329
+            addCriterion("updatetime >", value, "updatetime");
330
+            return (Criteria) this;
331
+        }
332
+
333
+        public Criteria andUpdatetimeGreaterThanOrEqualTo(Date value) {
334
+            addCriterion("updatetime >=", value, "updatetime");
335
+            return (Criteria) this;
336
+        }
337
+
338
+        public Criteria andUpdatetimeLessThan(Date value) {
339
+            addCriterion("updatetime <", value, "updatetime");
340
+            return (Criteria) this;
341
+        }
342
+
343
+        public Criteria andUpdatetimeLessThanOrEqualTo(Date value) {
344
+            addCriterion("updatetime <=", value, "updatetime");
345
+            return (Criteria) this;
346
+        }
347
+
348
+        public Criteria andUpdatetimeIn(List<Date> values) {
349
+            addCriterion("updatetime in", values, "updatetime");
350
+            return (Criteria) this;
351
+        }
352
+
353
+        public Criteria andUpdatetimeNotIn(List<Date> values) {
354
+            addCriterion("updatetime not in", values, "updatetime");
355
+            return (Criteria) this;
356
+        }
357
+
358
+        public Criteria andUpdatetimeBetween(Date value1, Date value2) {
359
+            addCriterion("updatetime between", value1, value2, "updatetime");
360
+            return (Criteria) this;
361
+        }
362
+
363
+        public Criteria andUpdatetimeNotBetween(Date value1, Date value2) {
364
+            addCriterion("updatetime not between", value1, value2, "updatetime");
365
+            return (Criteria) this;
366
+        }
367
+    }
368
+
369
+    public static class Criteria extends GeneratedCriteria {
370
+
371
+        protected Criteria() {
372
+            super();
373
+        }
374
+    }
375
+
376
+    public static class Criterion {
377
+        private String condition;
378
+
379
+        private Object value;
380
+
381
+        private Object secondValue;
382
+
383
+        private boolean noValue;
384
+
385
+        private boolean singleValue;
386
+
387
+        private boolean betweenValue;
388
+
389
+        private boolean listValue;
390
+
391
+        private String typeHandler;
392
+
393
+        public String getCondition() {
394
+            return condition;
395
+        }
396
+
397
+        public Object getValue() {
398
+            return value;
399
+        }
400
+
401
+        public Object getSecondValue() {
402
+            return secondValue;
403
+        }
404
+
405
+        public boolean isNoValue() {
406
+            return noValue;
407
+        }
408
+
409
+        public boolean isSingleValue() {
410
+            return singleValue;
411
+        }
412
+
413
+        public boolean isBetweenValue() {
414
+            return betweenValue;
415
+        }
416
+
417
+        public boolean isListValue() {
418
+            return listValue;
419
+        }
420
+
421
+        public String getTypeHandler() {
422
+            return typeHandler;
423
+        }
424
+
425
+        protected Criterion(String condition) {
426
+            super();
427
+            this.condition = condition;
428
+            this.typeHandler = null;
429
+            this.noValue = true;
430
+        }
431
+
432
+        protected Criterion(String condition, Object value, String typeHandler) {
433
+            super();
434
+            this.condition = condition;
435
+            this.value = value;
436
+            this.typeHandler = typeHandler;
437
+            if (value instanceof List<?>) {
438
+                this.listValue = true;
439
+            } else {
440
+                this.singleValue = true;
441
+            }
442
+        }
443
+
444
+        protected Criterion(String condition, Object value) {
445
+            this(condition, value, null);
446
+        }
447
+
448
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
449
+            super();
450
+            this.condition = condition;
451
+            this.value = value;
452
+            this.secondValue = secondValue;
453
+            this.typeHandler = typeHandler;
454
+            this.betweenValue = true;
455
+        }
456
+
457
+        protected Criterion(String condition, Object value, Object secondValue) {
458
+            this(condition, value, secondValue, null);
459
+        }
460
+    }
461
+}

+ 46 - 0
src/main/java/com/chinaitop/depot/system/model/SysCodeKey.java

@@ -0,0 +1,46 @@
1
+package com.chinaitop.depot.system.model;
2
+
3
+public class SysCodeKey {
4
+    private Integer orgId;
5
+
6
+    private String sCode;
7
+
8
+    public SysCodeKey() {}
9
+
10
+    public SysCodeKey(int orgId, String sCode) {
11
+        this.orgId = orgId;
12
+        this.sCode = sCode;
13
+    }
14
+
15
+    /**
16
+     * 组织机构ID
17
+     * @return
18
+     */
19
+    public Integer getOrgId() {
20
+        return orgId;
21
+    }
22
+
23
+    /**
24
+     * 组织机构ID
25
+     * @param orgId
26
+     */
27
+    public void setOrgId(Integer orgId) {
28
+        this.orgId = orgId;
29
+    }
30
+
31
+    /**
32
+     * 标识符号
33
+     * @return
34
+     */
35
+    public String getsCode() {
36
+        return sCode;
37
+    }
38
+
39
+    /**
40
+     * 标识符号
41
+     * @param sCode
42
+     */
43
+    public void setsCode(String sCode) {
44
+        this.sCode = sCode == null ? null : sCode.trim();
45
+    }
46
+}

+ 24 - 0
src/main/java/com/chinaitop/depot/system/service/SysCodeService.java

@@ -0,0 +1,24 @@
1
+package com.chinaitop.depot.system.service;
2
+
3
+import com.chinaitop.depot.system.model.SysCode;
4
+
5
+public interface SysCodeService {
6
+
7
+	/**
8
+	 * 按主键查询一条系统配置数据
9
+	 * @param orgId
10
+	 * @param sCode
11
+	 * @return
12
+	 * @throws Exception
13
+	 */
14
+	public SysCode querySysCode(Integer orgId, String sCode) throws Exception;
15
+	
16
+	/**
17
+	 * 按主键查询一条系统配置数据并返回配置value
18
+	 * @param orgId
19
+	 * @param sCode
20
+	 * @return
21
+	 * @throws Exception
22
+	 */
23
+	public String getSVal(Integer orgId, String sCode) throws Exception;
24
+}

+ 51 - 0
src/main/java/com/chinaitop/depot/system/service/impl/SysCodeServiceImpl.java

@@ -0,0 +1,51 @@
1
+package com.chinaitop.depot.system.service.impl;
2
+
3
+import javax.annotation.Resource;
4
+
5
+import org.apache.commons.lang3.StringUtils;
6
+import org.springframework.stereotype.Service;
7
+
8
+import com.chinaitop.depot.system.mapper.SysCodeMapper;
9
+import com.chinaitop.depot.system.model.SysCode;
10
+import com.chinaitop.depot.system.model.SysCodeKey;
11
+import com.chinaitop.depot.system.service.SysCodeService;
12
+
13
+@Service
14
+public class SysCodeServiceImpl implements SysCodeService {
15
+
16
+	@Resource
17
+	private SysCodeMapper sysCodeMapper;
18
+
19
+	@Override
20
+	public SysCode querySysCode(Integer orgId, String sCode) throws Exception {
21
+		SysCodeKey sysCodeKey = new SysCodeKey();
22
+		sysCodeKey.setOrgId(orgId);
23
+		sysCodeKey.setsCode(sCode);
24
+		SysCode en = sysCodeMapper.selectByPrimaryKey(sysCodeKey);
25
+		return en;
26
+	}
27
+
28
+	@Override
29
+	public String getSVal(Integer orgId, String sCode) throws Exception {
30
+		String val = "";
31
+		StringBuffer sbf = new StringBuffer(100);
32
+		if (StringUtils.isBlank(sCode)) {
33
+			sbf.append("code不能为空!");
34
+		}
35
+		if (null == orgId) {
36
+			sbf.append("orgId不能为空!");
37
+		}
38
+		if (sbf.toString().length() > 0) {
39
+			val = sbf.toString();
40
+		} else {
41
+			SysCode sysCode = querySysCode(orgId, sCode);
42
+			if (null != sysCode) {
43
+				val = sysCode.getsVal();
44
+			} else {
45
+				val = "无此配置";
46
+			}
47
+		}
48
+		return val;
49
+	}
50
+
51
+}

+ 8 - 0
src/main/java/com/chinaitop/depot/utils/SysCodeUtils.java

@@ -0,0 +1,8 @@
1
+package com.chinaitop.depot.utils;
2
+
3
+public class SysCodeUtils {
4
+
5
+    public static final String CW_CODE = "cw";
6
+    
7
+    public static final String PAD_CODE = "pad";
8
+}