|
@@ -10,45 +10,47 @@
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectWmsWarehouseList" parameterType="WmsWarehouse" resultType="WmsWarehouse">
|
|
<select id="selectWmsWarehouseList" parameterType="WmsWarehouse" resultType="WmsWarehouse">
|
|
|
- select WmsWarehouse.warehouseId, warehouseName, warehouseType, warehouseUsestatus, warehouseManager,
|
|
|
|
|
- warehouseManagername, warehouseCreator, warehouseCreatorname, warehouseCreateddate,WmsWarehouse.tid
|
|
|
|
|
- from WmsWarehouse
|
|
|
|
|
- LEFT JOIN FmsLandHouse on WmsWarehouse.warehouseId = FmsLandHouse.warehouseId
|
|
|
|
|
|
|
+ select w.warehouseId, warehouseName, warehouseType, warehouseUsestatus, warehouseManager,
|
|
|
|
|
+ warehouseManagername, warehouseCreator, warehouseCreatorname, warehouseCreateddate, w.tid
|
|
|
|
|
+ FROM WmsWarehouse as w
|
|
|
|
|
+ LEFT JOIN FmsLandHouse AS f on w.warehouseId = f.warehouseId
|
|
|
<where>
|
|
<where>
|
|
|
<if test="warehouseName != null and warehouseName != ''">and warehouseName like concat('%',
|
|
<if test="warehouseName != null and warehouseName != ''">and warehouseName like concat('%',
|
|
|
#{warehouseName}, '%')
|
|
#{warehouseName}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="warehouseType != null and warehouseType != '' and warehouseType != '-1'">and warehouseType =
|
|
|
|
|
- #{warehouseType}
|
|
|
|
|
|
|
+ <if test="warehouseType != null and warehouseType != '' and warehouseType != '-1'">
|
|
|
|
|
+ and warehouseType = #{warehouseType}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="warehouseUsestatus != null and warehouseUsestatus != ''">and warehouseUsestatus =
|
|
<if test="warehouseUsestatus != null and warehouseUsestatus != ''">and warehouseUsestatus =
|
|
|
#{warehouseUsestatus}
|
|
#{warehouseUsestatus}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="warehouseManager != null and warehouseManager != ''">and warehouseManager = #{warehouseManager}
|
|
|
|
|
|
|
+ <if test="warehouseManager != null and warehouseManager != ''">
|
|
|
|
|
+ and warehouseManager = #{warehouseManager}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="warehouseManagername != null and warehouseManagername != ''">and warehouseManagername like
|
|
|
|
|
- concat('%', #{warehouseManagername}, '%')
|
|
|
|
|
|
|
+ <if test="warehouseManagername != null and warehouseManagername != ''">
|
|
|
|
|
+ and warehouseManagername like concat('%', #{warehouseManagername}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="warehouseCreator != null and warehouseCreator != ''">and warehouseCreator = #{warehouseCreator}
|
|
|
|
|
|
|
+ <if test="warehouseCreator != null and warehouseCreator != ''">
|
|
|
|
|
+ and warehouseCreator = #{warehouseCreator}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="warehouseCreatorname != null and warehouseCreatorname != ''">and warehouseCreatorname like
|
|
|
|
|
- concat('%', #{warehouseCreatorname}, '%')
|
|
|
|
|
|
|
+ <if test="warehouseCreatorname != null and warehouseCreatorname != ''">
|
|
|
|
|
+ and warehouseCreatorname like concat('%', #{warehouseCreatorname}, '%')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="warehouseCreateddate != null and warehouseCreateddate != ''">and warehouseCreateddate =
|
|
|
|
|
- #{warehouseCreateddate}
|
|
|
|
|
|
|
+ <if test="warehouseCreateddate != null and warehouseCreateddate != ''">
|
|
|
|
|
+ and warehouseCreateddate = #{warehouseCreateddate}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="warehouseIds != null and warehouseIds.size > 0">
|
|
<if test="warehouseIds != null and warehouseIds.size > 0">
|
|
|
- and warehouseId in
|
|
|
|
|
|
|
+ and w.warehouseId in
|
|
|
<foreach item="warehouseId" collection="warehouseIds" open="(" separator="," close=")">
|
|
<foreach item="warehouseId" collection="warehouseIds" open="(" separator="," close=")">
|
|
|
#{warehouseId}
|
|
#{warehouseId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="landId != null and landId != ''">
|
|
<if test="landId != null and landId != ''">
|
|
|
- and FmsLandHouse.landId = #{landId}
|
|
|
|
|
|
|
+ and f.landId = #{landId}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="tid != null and tid != '-1'">and WmsWarehouse.tid = #{tid}</if>
|
|
|
|
|
|
|
+ <if test="tid != null and tid != '-1'">and w.tid = #{tid}</if>
|
|
|
</where>
|
|
</where>
|
|
|
- group by WmsWarehouse.warehouseId
|
|
|
|
|
|
|
+ group by w.warehouseId
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectWmsWarehouseByWarehouseId" parameterType="String" resultType="WmsWarehouse">
|
|
<select id="selectWmsWarehouseByWarehouseId" parameterType="String" resultType="WmsWarehouse">
|
|
@@ -58,24 +60,19 @@
|
|
|
</select>
|
|
</select>
|
|
|
<select id="selectUserManagerWarehouseIds" resultType="java.lang.String">
|
|
<select id="selectUserManagerWarehouseIds" resultType="java.lang.String">
|
|
|
(
|
|
(
|
|
|
- SELECT
|
|
|
|
|
- warehouseId
|
|
|
|
|
- FROM
|
|
|
|
|
- FmsLandHouse
|
|
|
|
|
- WHERE
|
|
|
|
|
- landId IN ( SELECT landId FROM FmsLand WHERE landManager = #{userId}
|
|
|
|
|
- <if test="tid != null and tid != '-1'">and tid = #{tid}</if>
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ SELECT warehouseId
|
|
|
|
|
+ FROM FmsLandHouse
|
|
|
|
|
+ WHERE landId IN (
|
|
|
|
|
+ SELECT landId
|
|
|
|
|
+ FROM FmsLand
|
|
|
|
|
+ WHERE landManager = #{userId} and tid = #{tid}
|
|
|
|
|
+ )
|
|
|
)
|
|
)
|
|
|
UNION ALL
|
|
UNION ALL
|
|
|
(
|
|
(
|
|
|
- SELECT
|
|
|
|
|
- warehouseId
|
|
|
|
|
- FROM
|
|
|
|
|
- WmsWarehouse
|
|
|
|
|
- WHERE
|
|
|
|
|
- warehouseManager = #{userId}
|
|
|
|
|
- <if test="tid != null and tid != '-1'">and tid = #{tid}</if>
|
|
|
|
|
|
|
+ SELECT warehouseId
|
|
|
|
|
+ FROM WmsWarehouse
|
|
|
|
|
+ WHERE warehouseManager = #{userId} and tid = #{tid}
|
|
|
)
|
|
)
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|