WarehouseMapper.xml
6.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huaheng.pc.config.warehouse.mapper.WarehouseMapper">
<resultMap id="BaseResultMap" type="com.huaheng.pc.config.warehouse.domain.Warehouse">
<!--@mbg.generated-->
<id column="code" jdbcType="VARCHAR" property="code" />
<result column="address1" jdbcType="VARCHAR" property="address1" />
<result column="address2" jdbcType="VARCHAR" property="address2" />
<result column="city" jdbcType="VARCHAR" property="city" />
<result column="state" jdbcType="VARCHAR" property="state" />
<result column="district" jdbcType="VARCHAR" property="district" />
<result column="country" jdbcType="VARCHAR" property="country" />
<result column="postalCode" jdbcType="VARCHAR" property="postalCode" />
<result column="attentionTo" jdbcType="VARCHAR" property="attentionTo" />
<result column="phoneNum" jdbcType="VARCHAR" property="phoneNum" />
<result column="faxNum" jdbcType="VARCHAR" property="faxNum" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="hostCode" jdbcType="VARCHAR" property="hostCode" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="enable" jdbcType="INTEGER" property="enable" />
<result column="orgCode" jdbcType="VARCHAR" property="orgCode" />
<result column="created" jdbcType="TIMESTAMP" property="created" />
<result column="createdBy" jdbcType="VARCHAR" property="createdBy" />
<result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" />
<result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" />
<result column="version" jdbcType="INTEGER" property="version" />
<result column="userDef1" jdbcType="VARCHAR" property="userDef1" />
<result column="userDef2" jdbcType="VARCHAR" property="userDef2" />
<result column="userDef3" jdbcType="VARCHAR" property="userDef3" />
<result column="userDef4" jdbcType="VARCHAR" property="userDef4" />
<result column="userDef5" jdbcType="VARCHAR" property="userDef5" />
<result column="userDef6" jdbcType="VARCHAR" property="userDef6" />
<result column="userDef7" jdbcType="VARCHAR" property="userDef7" />
<result column="userDef8" jdbcType="VARCHAR" property="userDef8" />
<result column="deleted" jdbcType="BIT" property="deleted" />
</resultMap>
<select id="wareHouseAll" resultType="com.huaheng.pc.system.user.domain.SysUserWarehouse">
select code, address1, address2, city, `state`, district, country, postalCode, attentionTo,
phoneNum, faxNum, email, hostCode, `name`, `enable`, orgCode, created, createdBy,
lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5,
userDef6, userDef7, userDef8, deleted from warehouse
</select>
<select id="selectWarehouseByUserId" resultType="com.huaheng.pc.config.warehouse.domain.Warehouse">
SELECT r.`name`, r.code ,r.enable
FROM sys_user_warehouse ur
LEFT JOIN warehouse r ON r.code = ur.warehouseCode
WHERE ur.userId =#{userId}
</select>
<select id="selectWarehouseAll" resultType="com.huaheng.pc.config.warehouse.domain.Warehouse">
select code, address1, address2, city, `state`, district, country, postalCode, attentionTo,
phoneNum, faxNum, email, hostCode, `name`, `enable`, orgCode, created, createdBy,
lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5,
userDef6, userDef7, userDef8, deleted
from warehouse where deleted =false
</select>
<sql id="Base_Column_List">
<!--@mbg.generated-->
code, address1, address2, city, `state`, district, country, postalCode, attentionTo,
phoneNum, faxNum, email, hostCode, `name`, `enable`, orgCode, created, createdBy,
lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5,
userDef6, userDef7, userDef8, deleted
</sql>
<insert id="companyCopy">
insert into warehouse_company(warehouseCode,companyId,companyCode)
select #{newWarehouseCode},companyId,companyCode from warehouse_company where warehouseCode=#{warehouseCode}
</insert>
<select id="selectListEntityByEqual" resultType="com.huaheng.pc.config.warehouse.domain.Warehouse">
SELECT code, name, address1, address2, city, state, district, country, postalCode, attentionTo, phoneNum, faxNum,
email, hostCode,orgCode, created, createdBy, lastUpdated, lastUpdatedBy, enable, deleted, userDef1, userDef2, userDef3
FROM warehouse
<where>
<if test="code != null">
AND code = #{code}
</if>
<if test="name != null">
AND name = #{name}
</if>
<if test="address1 != null">
AND address1 = #{address1}
</if>
<if test="address2 != null">
AND address2 = #{address2}
</if>
<if test="city != null">
AND city = #{city}
</if>
<if test="state != null">
AND state = #{state}
</if>
<if test="district != null">
AND district = #{district}
</if>
<if test="country != null">
AND country = #{country}
</if>
<if test="postalCode != null">
AND postalCode = #{postalCode}
</if>
<if test="attentionTo != null">
AND attentionTo = #{attentionTo}
</if>
<if test="phoneNum != null">
AND phoneNum = #{phoneNum}
</if>
<if test="faxNum != null">
AND faxNum = #{faxNum}
</if>
<if test="email != null">
AND email = #{email}
</if>
<if test="hostCode != null">
AND hostCode = #{hostCode}
</if>
<if test="orgCode != null">
AND orgCode = #{orgCode}
</if>
<if test="created != null">
AND created = #{created}
</if>
<if test="createdBy != null">
AND createdBy = #{createdBy}
</if>
<if test="lastUpdated != null">
AND lastUpdated = #{lastUpdated}
</if>
<if test="lastUpdatedBy != null">
AND lastUpdatedBy = #{lastUpdatedBy}
</if>
<if test="enable != null">
AND enable = #{enable}
</if>
<if test="deleted != null">
AND deleted = #{deleted}
</if>
<if test="userDef1 != null">
AND userDef1 = #{userDef1}
</if>
<if test="userDef2 != null">
AND userDef2 = #{userDef2}
</if>
<if test="userDef3 != null">
AND userDef3 = #{userDef3}
</if>
</where>
</select>
<insert id="userCopy">
insert into sys_user_warehouse(userId,warehouseCode)
select userId,#{newWarehouseCode} from sys_user_warehouse where warehouseCode=#{warehouseCode}
</insert>
</mapper>