zss
2023-08-15 56f89b4a45a561ff017ffd1e611e542130d046a0
inventory-server/src/main/resources/mapper/RepertoryMapper.xml
@@ -6,27 +6,35 @@
        name,
        specifications,
        code,
        requirements,
        order_code,
        seat,
        check_state,
        user_name,
        DATE_FORMAT(create_time, '%Y-%m-%d') '入库日期',
        note
        from mom_ocean.repertory
        <where>
            and state=1
            <if test="name!=null">
                and name =#{name}
            <if test="name!=null and name!=''">
                and name LIKE CONCAT('%',#{name},'%')
            </if>
            <if test="specifications!=null ">
                and specifications=#{specifications}
            <if test="specifications!=null and specifications!=''">
                and specifications LIKE CONCAT('%',#{specifications},'%')
            </if>
            <if test="time!=null ">
            <if test="time!=null and time!=''">
                and create_time=#{time}
            </if>
            <if test="type!=null">
            <if test="type!=null and type!=''">
                and type=#{type}
            </if>
            <if test="checkState!=null and checkState!=''">
                and check_state=#{checkState}
            </if>
            order by id desc
        </where>
    </select>
    <!--查询库存三个字段给添加销售单-->
    <select id="getSale" resultType="java.util.Map">
        select id, name, specifications, unit
        from mom_ocean.repertory
        where state = 1
    </select>
</mapper>