<?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.zfire.jiasm.syncdata.dao.mapper.AppraiseMapper">

    <select id="getAppraise" parameterType="com.zfire.jiasm.syncdata.parameter.ReAppointment" resultType="com.zfire.jiasm.syncdata.plus.entity.OrderAppraise">
        select a.out_satisfaction_id
        from order_appraise a
                 left join order_base b on a.order_base_id = b.id and b.order_type='REPAIR'
        where a.pid = #{request.id}
    </select>

    <select id="getOldId" parameterType="com.zfire.jiasm.syncdata.parameter.ReAppointment" resultType="com.zfire.jiasm.syncdata.plus.entity.OrderAppraise">
        select a.id
        from order_appraise a inner join order_base b
             on b.pgid = #{request.id} and a.order_base_id = b.id
                    and a.appraise_status !='A'
    </select>

</mapper>
