<?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.dgtly.system.mapper.HanaSalesOrderMapper">

    <select id="selectOrderBaseList" resultType="java.lang.String">
        SELECT
            ob.id
        FROM
            sales_order_base ob
                LEFT JOIN meta_hana_sales_order so ON so.DOC_NUMBER = ob.order_number
        WHERE
            so.CREDIT_STATUS = '信用未通过' and ob.is_delete='0'
        GROUP BY
            ob.order_number
    </select>

    <update id="deleteLogic" parameterType="int">
        UPDATE sales_order_base
        SET is_delete = '1'
        WHERE 1=1
        <if test="list !=null and list.size > 0"> and id in
            <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
                #{id}
            </foreach>
        </if>
    </update>
</mapper>