<?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.boco.nbd.wios.flow.mapper.def.OrderAbnormalMapper"> <select id="getOrderAbnormalAll" resultType="com.boco.nbd.wios.flow.entity.bo.OrderAbnormalBO"> select a.id, a.oem_name, b.code oem_code, case when a.region_level=1 then a.country_name when a.region_level=2 then a.area_name when a.region_level=3 then a.province_name when a.region_level=4 then a.region_name when a.region_level=5 then a.city_name end region_name, a.address, case a.user_sex when 0 then '女' when 1 then '男' else '未知' end user_sex, a.user_phone, case a.survey_before_sale_enable when 0 then '否' when 1 then '是' end survey_before_sale_enable, a.vehicle_model, a.vehicle_chassis_no, a.wallbox_model, a.vehicle_parking_status, a.vehicle_parking_no, a.out_order_id, date_format(a.invoice_time, '%Y-%m-%d') invoice_time, a.oem_agent_name, a.oem_agent_contact_name, a.oem_agent_info, a.create_time, a.status, a.pack_type, a.overtime_type, case a.estate_type when 1 then '普通高层' when 2 then '商用两住' when 3 then '别墅' when 4 then '公司' when 5 then '厂房' when 6 then '自建房' when 7 then '其他' end estate_type, case a.has_independent_parking when 0 then '否' when 1 then '是' end has_independent_parking, case a.install_position when 1 then '室内' when 2 then '室外' end install_position, case a.property_agree when 0 then '不同意' when 1 then '同意' end property_agree, case a.electric_expand when 0 then '否' when 1 then '是' end electric_expand, case a.need_erect_pile when 0 then '否' when 1 then '是' end need_erect_pile, case a.manu_dispatch_enable when 0 then '否' when 1 then '是' end manu_dispatch_enable, case a.is_need_survey when 0 then '否' when 1 then '是' end is_need_survey, case a.install_emergency_level when 1 then '一般' when 2 then '紧急' end install_emergency_level from t_order_abnormal a left join t_oem b on a.oem_id = b.id left join t_region c on a.region_id = c.id </select> </mapper>