package com.ltkj.hosp.mapper;
|
|
import java.util.Date;
|
import java.util.List;
|
import java.util.Map;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.ltkj.hosp.domain.TjCustomer;
|
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;
|
|
/**
|
* 体检记录Mapper接口
|
*
|
* @author ltkj
|
* @date 2022-11-21
|
*/
|
@Mapper
|
public interface TjOrderMapper extends BaseMapper<TjOrder> {
|
/**
|
* 查询体检记录
|
*
|
* @param orderId 体检记录主键
|
* @return 体检记录
|
*/
|
public TjOrder selectTjOrderByOrderId(Long orderId);
|
|
/**
|
* 查询体检记录列表
|
*
|
* @param tjOrder 体检记录
|
* @return 体检记录集合
|
*/
|
public List<TjOrder> selectTjOrderList(TjOrder tjOrder);
|
|
|
public List<TjOrder> selectExportOrderList(TjOrder tjOrder);
|
|
// /*
|
// * 根据tjNumber查询体检记录
|
// * */
|
// public List<TjOrder> selectTjOrderListByTjNumber(Long tjNumber);
|
|
/**
|
* 新增体检记录
|
*
|
* @param tjOrder 体检记录
|
* @return 结果
|
*/
|
public int insertTjOrder(TjOrder tjOrder);
|
|
/**
|
* 修改体检记录
|
*
|
* @param tjOrder 体检记录
|
* @return 结果
|
*/
|
public int updateTjOrder(TjOrder tjOrder);
|
|
/**
|
* 删除体检记录
|
*
|
* @param orderId 体检记录主键
|
* @return 结果
|
*/
|
public int deleteTjOrderByOrderId(Long orderId);
|
|
/**
|
* 批量删除体检记录
|
*
|
* @param orderIds 需要删除的数据主键集合
|
* @return 结果
|
*/
|
public int deleteTjOrderByOrderIds(Long[] orderIds);
|
|
|
@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" +
|
" 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<LineChartsVo> getLine();
|
|
|
@Select("SELECT * FROM tj_order WHERE tj_number RLIKE #{tjNum} AND deleted='0' ORDER BY create_time DESC")
|
public List<TjOrder> getOrderListByLikeTjNum(@Param("tjNum") String tjNum);
|
|
|
@Select("SELECT * FROM tj_order WHERE user_id = #{cusId} AND deleted='0' ORDER BY create_time DESC")
|
public List<TjOrder> getOrderListByCusId(@Param("cusId") String cusId);
|
|
@Select("SELECT * FROM tj_order WHERE tj_number = #{tjNum} AND deleted='0' ")
|
public TjOrder getOrderByTjNum(String tjNum);
|
|
List<TjOrder> getTjOrderList(@Param("tjNum")String tjNum,
|
@Param("checkStatus")Integer checkStatus,
|
@Param("compId")Long compId,
|
@Param("beginTime") Date beginTime,
|
@Param("endTime") Date endTime);
|
|
|
List<TjOrder> getWCsTjOrderList(@Param("tjNum")String tjNum,
|
@Param("compId")Long compId,
|
@Param("beginTime") Date beginTime,
|
@Param("endTime") Date endTime);
|
|
List<TjOrder> getYCsTjOrderList(@Param("tjNum")String tjNum,
|
@Param("compId")Long compId,
|
@Param("beginTime") Date beginTime,
|
@Param("endTime") Date endTime);
|
|
|
List<TjOrder> getCsTjOrderList1(@Param("tjNum")String tjNum,
|
@Param("checkStatus")Integer checkStatus,
|
@Param("compId")Long compId,
|
@Param("beginTime") Date beginTime,
|
@Param("endTime") Date endTime);
|
|
@Select("SELECT * FROM tj_order WHERE deleted='0' and user_id = #{userId} AND !ISNULL(finish_time)")
|
List<TjOrder> getTjOrderListByCusId(Long userId);
|
|
@Select("SELECT * FROM tj_order WHERE deleted='0' and user_id = #{userId} AND !ISNULL(finish_time)")
|
List<TjOrder> getCsTjOrderListByCusId(Long userId);
|
|
|
@Select("SELECT * FROM tj_order WHERE deleted='0' and user_id = #{userId} AND !ISNULL(finish_time) " +
|
"and !ISNULL(confirm_time) ")
|
List<TjOrder> getCsTjOrderListByCusId1(Long userId);
|
|
|
@Select("SELECT GROUP_CONCAT( DISTINCT b.pro_name SEPARATOR ';' ) aa FROM tj_order_remark a" +
|
" LEFT JOIN tj_project b ON a.pro_id=b.pro_id WHERE a.deleted=0 AND a.tj_number= #{tjNum} AND a.type !=2")
|
String getHistoryTjOrderProByTjNum(String tjNum);
|
|
|
@Select("SELECT * FROM tj_order WHERE deleted='0' and user_id =#{userId}" +
|
" AND !ISNULL(finish_time) ORDER BY create_time DESC LIMIT 1")
|
TjOrder getLastTjOrderListByCusId(Long userId);
|
|
|
//存储过程专用接口(总检)
|
List<List<?>> getCunChuGuoChengCustomerList(Map<String,Object> map);
|
|
|
//存储过程专用接口(初审)
|
List<List<?>> getCsCunChuGuoChengCustomerList(Map<String,Object> map);
|
|
|
@Select("SELECT count(*) FROM tj_order a WHERE a.deleted=0 and a.card_id=#{cardId}")
|
int selectTjOrderByCardId(String cardId);
|
|
|
@Select("SELECT a.card_id FROM tj_order a WHERE a.deleted=0")
|
List<String> selectTjOrderByCardId1();
|
}
|