|
|
|
@ -38,11 +38,11 @@
|
|
|
|
|
a4.name
|
|
|
|
|
thirdName4
|
|
|
|
|
from auth_warehouse
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a on a.code = auth_warehouse.thirdId
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a1 on a1.code = auth_warehouse.thirdId1
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a2 on a2.code = auth_warehouse.thirdId2
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a3 on a3.code = auth_warehouse.thirdId3
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a4 on a4.code = auth_warehouse.thirdId4
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a on a.code = auth_warehouse.thirdId
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a1 on a1.code = auth_warehouse.thirdId1
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a2 on a2.code = auth_warehouse.thirdId2
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a3 on a3.code = auth_warehouse.thirdId3
|
|
|
|
|
LEFT JOIN thr_inv_warehouse a4 on a4.code = auth_warehouse.thirdId4
|
|
|
|
|
<where>
|
|
|
|
|
<if test="code != '' and code != null">
|
|
|
|
|
AND auth_warehouse.code = #{code}
|
|
|
|
@ -61,9 +61,9 @@
|
|
|
|
|
<select id="filterGroupInvSub" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest"
|
|
|
|
|
resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
|
|
|
|
|
select auth_warehouse.*, auth_dept.`name` AS warehouseName from auth_warehouse
|
|
|
|
|
INNER JOIN
|
|
|
|
|
auth_dept
|
|
|
|
|
on auth_warehouse.parentId = auth_dept.code
|
|
|
|
|
INNER JOIN
|
|
|
|
|
auth_dept
|
|
|
|
|
on auth_warehouse.parentId = auth_dept.code
|
|
|
|
|
<if test="userId != '' and userId != null">
|
|
|
|
|
INNER JOIN auth_warehouse_user on auth_warehouse.code = auth_warehouse_user.code
|
|
|
|
|
</if>
|
|
|
|
@ -88,7 +88,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
<if test="superiorCode != '' and superiorCode != null">
|
|
|
|
|
AND (auth_dept.code = #{superiorPcode}
|
|
|
|
|
OR auth_dept.pcode = #{superiorCode})
|
|
|
|
|
OR auth_dept.pcode = #{superiorCode})
|
|
|
|
|
</if>
|
|
|
|
|
<if test="subordinateCode != '' and subordinateCode != null">
|
|
|
|
|
AND auth_dept.pcode = #{subordinateCode}
|
|
|
|
@ -133,9 +133,9 @@
|
|
|
|
|
<insert id="insertInvSubWarehouse" keyProperty="id"
|
|
|
|
|
parameterType="com.glxp.api.entity.auth.InvWarehouseEntity">
|
|
|
|
|
replace
|
|
|
|
|
INTO auth_warehouse
|
|
|
|
|
( id, code, `name`, parentId, remark, defaultInv, advanceType, parentCode
|
|
|
|
|
, thirdId, thirdId1, thirdId2, thirdId3, thirdId4)
|
|
|
|
|
INTO auth_warehouse
|
|
|
|
|
( id, code, `name`, parentId, remark, defaultInv, advanceType, parentCode
|
|
|
|
|
, thirdId, thirdId1, thirdId2, thirdId3, thirdId4)
|
|
|
|
|
values (#{id},
|
|
|
|
|
#{code},
|
|
|
|
|
#{name},
|
|
|
|
@ -210,10 +210,11 @@
|
|
|
|
|
|
|
|
|
|
<insert id="importInvSubWarehouse" parameterType="java.util.List">
|
|
|
|
|
replace
|
|
|
|
|
into auth_warehouse
|
|
|
|
|
(id, code, `name`, parentId, remark, defaultInv, parentCode, advanceType, thirdId, thirdId1, thirdId2, thirdId3,
|
|
|
|
|
thirdId4)
|
|
|
|
|
values
|
|
|
|
|
into auth_warehouse
|
|
|
|
|
(id, code, `name`, parentId, remark, defaultInv, parentCode, advanceType, spUse, thirdId, thirdId1,
|
|
|
|
|
thirdId2, thirdId3,
|
|
|
|
|
thirdId4)
|
|
|
|
|
values
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<foreach collection="invWarehouseEntities" item="item" index="index" separator=",">
|
|
|
|
@ -225,6 +226,7 @@
|
|
|
|
|
#{item.defaultInv},
|
|
|
|
|
#{item.parentCode},
|
|
|
|
|
#{item.advanceType},
|
|
|
|
|
#{item.spUse},
|
|
|
|
|
#{item.thirdId},
|
|
|
|
|
#{item.thirdId1},
|
|
|
|
|
#{item.thirdId2},
|
|
|
|
@ -270,8 +272,8 @@
|
|
|
|
|
a.parentCode,
|
|
|
|
|
c.name parentInvName
|
|
|
|
|
FROM auth_warehouse a
|
|
|
|
|
left join auth_dept b on a.parentId = b.code
|
|
|
|
|
left join auth_warehouse c on a.parentCode = c.code
|
|
|
|
|
left join auth_dept b on a.parentId = b.code
|
|
|
|
|
left join auth_warehouse c on a.parentCode = c.code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="id != '' and id != null">
|
|
|
|
|
AND a.id = #{id}
|
|
|
|
@ -301,9 +303,9 @@
|
|
|
|
|
resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
|
|
|
|
|
select auth_warehouse.*, auth_dept.`name` AS warehouseName
|
|
|
|
|
from auth_warehouse
|
|
|
|
|
INNER JOIN
|
|
|
|
|
auth_dept
|
|
|
|
|
on auth_warehouse.parentId = auth_dept.code
|
|
|
|
|
INNER JOIN
|
|
|
|
|
auth_dept
|
|
|
|
|
on auth_warehouse.parentId = auth_dept.code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="subordinateCode != '' and subordinateCode != null">
|
|
|
|
|
AND auth_dept.pcode = #{subordinateCode}
|
|
|
|
@ -327,8 +329,8 @@
|
|
|
|
|
b.name parentName,
|
|
|
|
|
a.parentCode
|
|
|
|
|
from auth_warehouse a
|
|
|
|
|
left join auth_dept b on a.parentId = b.code
|
|
|
|
|
left join auth_warehouse_user c on a.code = c.code
|
|
|
|
|
left join auth_dept b on a.parentId = b.code
|
|
|
|
|
left join auth_warehouse_user c on a.code = c.code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="userId != null">
|
|
|
|
|
AND c.userId = #{userId}
|
|
|
|
@ -350,8 +352,8 @@
|
|
|
|
|
auth_warehouse.parentCode,
|
|
|
|
|
auth_dept.name warehouseName
|
|
|
|
|
from auth_warehouse
|
|
|
|
|
inner join auth_dept on auth_warehouse.parentId = auth_dept.code
|
|
|
|
|
inner join auth_warehouse_user on auth_warehouse.code = auth_warehouse_user.code
|
|
|
|
|
inner join auth_dept on auth_warehouse.parentId = auth_dept.code
|
|
|
|
|
inner join auth_warehouse_user on auth_warehouse.code = auth_warehouse_user.code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="userId != null">
|
|
|
|
|
AND auth_warehouse_user.userId = #{userId}
|
|
|
|
@ -362,6 +364,9 @@
|
|
|
|
|
<if test="advanceType != null">
|
|
|
|
|
AND auth_warehouse.advanceType = #{advanceType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="spUse != null">
|
|
|
|
|
AND auth_warehouse.spUse = #{spUse}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|