select thisTab.id, thisTab.fee_system_no, thisTab.dispatch_no, thisTab.customer_name, thisTab.project_name, thisTab.order_date, thisTab.fee_name, thisTab.estimated_amount, thisTab.currency, thisTab.related_bill_name, thisTab.related_bill_status, thisTab.is_confirmed, thisTab.confirm_by, thisTab.confirm_time, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.create_time, thisTab.update_time, thisTab.deleted , thisTab.fee_type from estimated_receivable AS thisTab select count(0) from estimated_receivable as thisTab and thisTab.fee_system_no = #{feeSystemNo} and thisTab.dispatch_no = #{dispatchNo} and thisTab.customer_name like concat('%', #{customerName}, '%') and thisTab.project_name like concat('%', #{projectName}, '%') and thisTab.order_date = #{orderDate} and thisTab.fee_name like concat('%', #{feeName}, '%') and thisTab.estimated_amount = #{estimatedAmount} and thisTab.currency = #{currency} and thisTab.related_bill_name like concat('%', #{relatedBillName}, '%') and thisTab.related_bill_status = #{relatedBillStatus} and thisTab.is_confirmed = #{isConfirmed} and thisTab.confirm_by = #{confirmBy} and thisTab.confirm_time = #{confirmTime} and thisTab.deleted = #{deleted} and thisTab.fee_type = #{feeType} insert into estimated_receivable fee_system_no, dispatch_no, customer_name, project_name, order_date, fee_name, estimated_amount, currency, related_bill_name, related_bill_status, is_confirmed, confirm_by, confirm_time, remark, create_by, update_by, create_time, update_time, deleted, fee_type, #{feeSystemNo}, #{dispatchNo}, #{customerName}, #{projectName}, #{orderDate}, #{feeName}, #{estimatedAmount}, #{currency}, #{relatedBillName}, #{relatedBillStatus}, #{isConfirmed}, #{confirmBy}, #{confirmTime}, #{remark}, #{createBy}, #{updateBy}, #{createTime}, #{updateTime}, #{deleted}, #{feeType}, insert into estimated_receivable fee_system_no,dispatch_no,customer_name,project_name,order_date,fee_name,estimated_amount,currency,related_bill_name,related_bill_status,is_confirmed,confirm_by,confirm_time,remark,create_by,update_by,create_time,update_time,deleted,fee_type, #{item.feeSystemNo},#{item.dispatchNo},#{item.customerName},#{item.projectName},#{item.orderDate},#{item.feeName},#{item.estimatedAmount},#{item.currency},#{item.relatedBillName},#{item.relatedBillStatus},#{item.isConfirmed},#{item.confirmBy},#{item.confirmTime},#{item.remark},#{item.createBy},#{item.updateBy},#{item.createTime},#{item.updateTime},#{item.deleted},#{item.feeType}, update estimated_receivable fee_system_no = #{feeSystemNo}, dispatch_no = #{dispatchNo}, customer_name = #{customerName}, project_name = #{projectName}, order_date = #{orderDate}, fee_name = #{feeName}, estimated_amount = #{estimatedAmount}, currency = #{currency}, related_bill_name = #{relatedBillName}, related_bill_status = #{relatedBillStatus}, is_confirmed = #{isConfirmed}, confirm_by = #{confirmBy}, confirm_time = #{confirmTime}, remark = #{remark}, create_by = #{createBy}, update_by = #{updateBy}, create_time = #{createTime}, update_time = #{updateTime}, deleted = #{deleted}, fee_type = #{feeType}, where id = #{id} update estimated_receivable fee_system_no = #{item.feeSystemNo}, dispatch_no = #{item.dispatchNo}, customer_name = #{item.customerName}, project_name = #{item.projectName}, order_date = #{item.orderDate}, fee_name = #{item.feeName}, estimated_amount = #{item.estimatedAmount}, currency = #{item.currency}, related_bill_name = #{item.relatedBillName}, related_bill_status = #{item.relatedBillStatus}, is_confirmed = #{item.isConfirmed}, confirm_by = #{item.confirmBy}, confirm_time = #{item.confirmTime}, remark = #{item.remark}, create_by = #{item.createBy}, update_by = #{item.updateBy}, create_time = #{item.createTime}, update_time = #{item.updateTime}, deleted = #{item.deleted}, fee_type = #{item.feeType}, where id = #{item.id} UPDATE estimated_receivable SET related_bill_status = #{status} , related_bill_name = #{billName} WHERE dispatch_no IN #{item} delete from estimated_receivable where id = #{id} delete from estimated_receivable where id in #{id}