You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

53 lines
2.3 KiB

<?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.xujie.sys.modules.pms.mapper.PartSpareLocationMapper">
<select id="getPartSpareLocation" resultType="com.xujie.sys.modules.pms.entity.PartSpareLocationVoData">
select
a.site,
a.location_id,
a.location_name,
a.warehouse_id,
dbo.getWarehouseName(a.site, a.warehouse_id) as warehouseName,
a.max_capacity,
a.active,
a.create_date,
a.create_by,
a.update_date,
a.update_by,
a.bu_no,
dbo.get_bu_desc(A.site, A.bu_no) buDesc
from part_spare_location a
<where>
A.site in (select site from eam_access_site where username = #{query.username})
and (A.site + '-' + A.bu_no) in (select * from dbo.query_bu(#{query.username}))
<if test="query.buDesc != null and query.buDesc != ''">
AND dbo.get_bu_desc (a.site, a.bu_no) = #{query.buDesc}
</if>
<if test="query.locationId != null and query.locationId != ''">
and a.location_id like '%' +#{query.locationId}+'%'
</if>
<if test="query.locationName != null and query.locationName != ''">
and a.location_name like '%' +#{query.locationName}+'%'
</if>
<if test="query.active != null and query.active != ''">
and a.active = #{query.active}
</if>
<if test="query.warehouseId != null and query.warehouseId != ''">
and a.warehouse_id = #{query.warehouseId}
</if>
</where>
</select>
<update id="updatePartSpareLocation" parameterType="com.xujie.sys.modules.pms.entity.vo.PartSpareLocationVo">
UPDATE part_spare_location
SET location_name = #{locationName},
warehouse_id = #{warehouseId},
max_capacity = #{maxCapacity,jdbcType=INTEGER},
active = #{active},
update_date = getDate(),
update_by = #{updateBy}
WHERE site = #{site} and bu_no = #{buNo} and location_id = #{locationId}
</update>
</mapper>