CyclecountDetailMapper.xml 1.36 KB
<?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.inventory.cyclecountDetail.mapper.CyclecountDetailMapper">
    <update id="comfirmAllWithNoGapQty">
        update cyclecount_detail set countedQty = systemQty,gapQty = 0,`status` = 10 WHERE headId = #{headId}
    </update>
    <update id="comfirmRemainWithNoGapQty">
        update cyclecount_detail set countedQty = systemQty,gapQty = 0,`status` = 10 WHERE headId = #{headId} and `status` != 10
    </update>


    <select id="selectDetails" resultType="com.huaheng.pc.inventory.cyclecountDetail.domain.CyclecountDetail">
        SELECT
t.*,
i.companyId,
i.companyCode,
i.locationId,
i.locationCode,
i.containerCode,
i.materialId,
i.materialCode,
m.specification materialSpecification,
i.receiptCode,
i.receiptId,
i.receiptDetailId,
i.batch,
i.lot,
i.project,
i.manufactureDate,
i.expirationDate,
i.`status` inventoryStatus,
i.id inventoryId,
h.code
FROM cyclecount_detail t join inventory i on t.inventoryId = i.id join material m on i.materialCode = m.`code` and i.warehouseId = m.warehouseId join cyclecount_header h on t.headId=h.id
<where>
    <if test="headId != null">
       t.headId = #{headId}
    </if>
    <if test="headId == null">
        t.headId = -1
    </if>
</where>

    </select>
</mapper>