zjh
2024-02-28 22c17adc3ec2a25e6656cd69961f49a888d433b3
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java
@@ -5,9 +5,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.hosp.domain.TjOrderDetail;
import com.ltkj.hosp.domain.TjProject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.*;
/**
 * 体检项目明细Mapper接口
@@ -73,10 +71,6 @@
            "  SELECT a.pro_id FROM tj_order_detail a WHERE !ISNULL(flowing_water_id) AND order_id=#{orderId})")
    public List<TjProject> selectTjOrderDetailListByFlowingWaterIdIsNotNull(String orderId);
    /**
     * 查询未缴费项目
     */
@@ -106,4 +100,63 @@
    @Select("SELECT * FROM tj_order_detail WHERE exception_desc='1'AND deleted='0' AND create_time BETWEEN IFNULL('${startDate}','1970-01-01 00:00:00') AND IFNULL('${endDate}',SYSDATE())")
    List<TjOrderDetail> getTjOrderDetailList(@Param("startDate") String startDate,@Param("endDate") String endDate);
    @Insert("\tINSERT INTO tj_order_detail(\n" +
//            "\torder_detail_id,\n" +
            "  order_id,\n" +
            "  pro_id,\n" +
            "  pro_result,\n" +
            "  tj_status,\n" +
            "  create_time,\n" +
            "  create_by,\n" +
            "  is_sampling,\n" +
            "  create_id,\n" +
            "  pro_type) \n" +
            "  \n" +
            "  SELECT #{orderId},a.pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.pro_id=b.pro_id  WHERE a.cus_id=#{cusId} and b.need_report='Y' \n" +
            "\t\t\n" +
            "\tUNION\n" +
            "  \n" +
            "\tSELECT #{orderId},a.parent_pro_id,IFNULL(b.pro_default,''),'0',SYSDATE(),#{userName},b.is_sampling,#{userId},IFNULL(a.pac_id,0) FROM tb_transition a LEFT JOIN tj_project b ON a.parent_pro_id=b.pro_id  WHERE a.cus_id=#{cusId} and b.need_report='Y' GROUP BY a.parent_pro_id")
     boolean saveTjOrderDetailsByCusId(@Param("cusId")String cusId,@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId);
    @Insert("INSERT INTO tj_pure_tone_test (\n" +
            "  tj_num,\n" +
            "\tcus_id,\n" +
            "\tcus_name,\n" +
            "\tpro_id,\n" +
            "\tpro_name,\n" +
            "\tcreate_by,\n" +
            "\tcreate_time,\n" +
            "\tcreate_id\n" +
            ")\n" +
            "SELECT #{tjNum},b.cus_id,b.cus_name,'1633660948860522619','纯音听阈'," +
            "#{userName},SYSDATE(),#{userId} FROM tb_transition a LEFT JOIN tj_customer b " +
            "ON a.cus_id=b.cus_idcard WHERE a.cus_id=#{cusId} AND a.parent_pro_id IN('1633660948860522619') GROUP BY a.cus_id")
    boolean saveTjPureToneTesByCusId(@Param("cusId")String cusId,@Param("tjNum")String tjNum,@Param("userName")String userName,@Param("userId") String userId);
    @Update("UPDATE tj_order_detail a SET\n" +
            "a.flowing_water_id=#{ls} ,\n" +
            "a.update_time=SYSDATE(),\n" +
            "a.update_by=#{userName},\n" +
            "a.update_id=#{userId}\n" +
            "WHERE a.order_id=#{orderId}")
    boolean updateTjOrderDetailsByOrderId(@Param("orderId")String orderId,@Param("userName")String userName,@Param("userId") String userId,@Param("ls")String ls);
    @Select("SELECT *\n" +
            "FROM `tj_order_detail` \n" +
            "where order_id=#{orderId}\n" +
            "and pro_id IN\n" +
            "(select pro_id from tj_project where pro_parent_id=#{proParentId})")
    public List<TjOrderDetail> getDetailByOrderIdAndParId(@Param("orderId")Long orderId,@Param("proParentId")Long proParentId);
    @Select("call pro_lis_sqdbgd(1,#{tjnumber,mode=IN})")
//    @Select("select * from test_detail")
    List<TjOrderDetail> addHuaYanTable(@Param("tjnumber") String tjnumber);
}