自动化立体仓库 - WMS系统
pjb
2025-10-16 0741e01ffbfb334399da40ab8266b49ef0f9e5a0
src/main/resources/mapper/ManLocDetlMapper.xml
@@ -28,7 +28,7 @@
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="modiTime" />
        <result column="modi_time" property="modiTime" />
        <result column="memo" property="memo" />
    </resultMap>
@@ -40,6 +40,9 @@
        <if test="loc_no != null and loc_no != ''">
            and mld.loc_no like concat('%',#{loc_no},'%')
        </if>
        <if test="locNo != null and locNo != ''">
            and mld.loc_no like concat('%',#{loc_no},'%')
        </if>
        <if test="matnr != null and matnr != ''">
            and mld.matnr like concat('%',#{matnr},'%')
        </if>
@@ -48,6 +51,26 @@
        </if>
        <if test="startTime!=null and endTime!=null">
            and mld.update_time between #{startTime} and #{endTime}
        </if>
    </sql>
    <sql id="locDetlCondition2">
        <if test="host_id != null and host_id != ''">
            and v.host_id = #{host_id}
        </if>
        <if test="loc_no != null and loc_no != ''">
            and v.loc_no like concat('%',#{loc_no},'%')
        </if>
        <if test="locNo != null and locNo != ''">
            and v.loc_no like concat('%',#{loc_no},'%')
        </if>
        <if test="matnr != null and matnr != ''">
            and v.matnr like concat('%',#{matnr},'%')
        </if>
        <if test="maktx != null and maktx != ''">
            and v.maktx like concat('%',#{maktx},'%')
        </if>
        <if test="startTime!=null and endTime!=null">
            and v.update_time between #{startTime} and #{endTime}
        </if>
    </sql>
@@ -254,6 +277,55 @@
        WHERE 1=1
        <include refid="locDetlCondition"></include>
    </select>
    <select id="selectAllPage" resultMap="BaseResultMap">
        select * from
        (
        SELECT
        ROW_NUMBER() over (order by v.loc_no desc) as row,
            v.*
        FROM [dbo].[man_view_asrs_saas] v
        WHERE 1=1
        <include refid="locDetlCondition2"></include>
        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
    <select id="selectAllPageSize" resultType="java.lang.Long">
        select
        count(1)
        FROM [dbo].[man_view_asrs_saas] v
        WHERE 1=1
        <include refid="locDetlCondition2"></include>
    </select>
    <select id="getViewLocBays" resultType="com.zy.asrs.entity.ViewLocMapDto">
        select
            uuid as locNo,
            SUBSTRING(uuid, 4, 2) as bay1,
            CASE
                WHEN barcode = '' THEN 'O'
                ELSE 'F'
                END AS locSts
        from
            man_node
        where
            level = 3
          and parent_name = #{row} + '排'
          and SUBSTRING(uuid, 7, 1) = #{lev}
    </select>
    <select id="selectLocDetlByLocNo" resultType="com.zy.asrs.entity.LocDetl">
        select
            loc_no as locNo,
            matnr,
            maktx,
            doc_num as orderNo,
            specs,
            zpallet,
            batch,
            anfme,
            unit
        from
            man_loc_detl
        where
            loc_no = #{locNo}
    </select>
    <update id="updateLocNo0">
@@ -271,5 +343,17 @@
        update man_loc_detl set anfme = #{anfme}
        where node_id = #{nodeId} ;
    </update>
    <update id="updateAnfme">
        update man_loc_detl set anfme = #{anfme}
        where loc_no = #{locNo} and matnr = #{matnr}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
            </when>
            <otherwise>
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
    </update>
</mapper>