<?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="cn.toesbieya.jxc.mapper.BizSellOrderMapper">
    <select id="export" resultType="cn.toesbieya.jxc.model.vo.export.SellOrderExport">
        select id,
               customer_name,
               cname,
               from_unixtime(ctime / 1000, '%Y-%m-%d %H:%m:%s') ctime,
               vname,
               case status
                       when 0 then '拟定'
                       when 1 then '待审核'
                       when 2 then '已审核'
                       end                                      status,
               case finish
                       when 0 then '未开始'
                       when 1 then '进行中'
                       when 2 then '已完成'
                       end                                      finish,
               from_unixtime(vtime / 1000, '%Y-%m-%d %H:%m:%s') vtime,
               from_unixtime(ftime / 1000, '%Y-%m-%d %H:%m:%s') ftime,
               total,
               remark
        from biz_sell_order ${ew.customSqlSegment}
    </select>
</mapper>