XiaoRuby
2023-08-11 7b09f233bde70508f6db7e08e983e9a2c4bb3e99
sale-server/src/main/resources/mapper/SaleMapper.xml
@@ -10,20 +10,19 @@
        type,
        DATE_FORMAT(delTime, '%Y-%m-%d') '交货日期'
        from mom_ocean.sale
        <where>
            state=1
            <if test="orderNumber!=null">
                and order_number=#{orderNumber}
            </if>
            <if test="name!=null">
                and name=#{name}
            </if>
            <if test="type!=null">
                and type=#{type}
            </if>
            <if test="delTime!=null">
                and DATE_FORMAT(delTime, '%Y-%m-%d')=#{delTime}
            </if>
        </where>
        where state=1
        <if test="orderNumber!=null and orderNumber!=''">
            and order_number like concat('%',#{orderNumber},'%')
        </if>
        <if test="name!=null and name!=''">
            and name LIKE CONCAT('%',#{name},'%')
        </if>
        <if test="type!=null and type!=''">
            and type=#{type}
        </if>
        <if test="delTime!=null and delTime!=''">
            and DATE_FORMAT(delTime, '%Y-%m-%d')=#{delTime}
        </if>
        order by id desc
    </select>
</mapper>