111
lige
2023-12-04 df62988da54d44526b0ea768b64a6e176c00e737
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java
@@ -6,6 +6,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.hosp.domain.TjOrder;
import com.ltkj.hosp.vodomain.LineChartsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -75,10 +76,35 @@
    public int deleteTjOrderByOrderIds(Long[] orderIds);
    List<TjOrder> getOrderList(Integer cusId);
    @Select(" select * from tj_order where 1 = 1 and deleted=0  and user_id = #{cusId}")
    List<TjOrder> getOrderList(Long cusId);
    List<TjOrder> getOrderList1();
//    @Select("select aa.date,\n" +
//            "      sum(if(c.tj_type='团队', ifnull(c.coun,0),0)) as tdcoun,\n" +
//            "      sum(if(c.tj_type='个人', ifnull(c.coun,0),0)) as grcoun,\n" +
//            "      sum(if(c.tj_type='报告', ifnull(c.coun,0),0)) as bgcoun \n" +
//            "  from (\n" +
//            "      SELECT date_sub(CURDATE(),interval @i:=@i+1 day) as date\n" +
//            "      from (select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all \n" +
//            "            select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all   \n" +
//            "            select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all  \n" +
//            "            select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all select 1 union all  \n" +
//            "            select 1 union all select 1) as a,\n" +
//            "            (select @i:= -1) b) aa \n" +
//            "  left join (\n" +
//            "      select date_format(create_time, '%Y-%m-%d') dat, tj_type, count(*) coun\n" +
//            "      from tj_order where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(create_time)\n" +
//            "      group by date_format(create_time, '%Y-%m-%d'),tj_type\n" +
//            "      union\n" +
//            "      select date_format(report_time, '%Y-%m-%d') dat, '报告' tj_type, count(*) coun\n" +
//            "      from tj_order where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(create_time)\n" +
//            "      group by date_format(report_time, '%Y-%m-%d')\n" +
//            "      ) c on c.dat =aa.date\n" +
//            "group by aa.date")
//    List<Map<Object, Object>> getLine();
    @Select("select aa.date,\n" +
            "      sum(if(c.tj_type='团队', ifnull(c.coun,0),0)) as tdcoun,\n" +
@@ -102,7 +128,7 @@
            "      group by date_format(report_time, '%Y-%m-%d')\n" +
            "      ) c on c.dat =aa.date\n" +
            "group by aa.date")
    List<Map<Object, Object>> getLine();
    List<LineChartsVo> getLine();
    @Select("SELECT * FROM tj_order WHERE tj_number RLIKE #{tjNum} AND deleted='0' ORDER BY create_time DESC")