CyclecountHeaderMapper.xml 868 Bytes
<?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.cyclecountHeader.mapper.CyclecountHeaderMapper">


    <select id="getLastCode" resultType="java.lang.String">
        SELECT code FROM cyclecount_header ORDER BY id DESC LIMIT 1
    </select>
    <select id="verifyToAdjust" resultType="java.lang.Integer">
        SELECT count(*) from inventory i join cyclecount_detail c on i.id = c.inventoryId WHERE i.qty != c.systemQty and c.headId = #{headId}
    </select>
    <select id="verifyToAdjust2" resultType="java.lang.Integer">
         SELECT count(*) from ( SELECT * from cyclecount_detail where inventoryId is not null and headId = #{headId}) t WHERE t.inventoryId not in (SELECT id from inventory);
    </select>
</mapper>