zjh
2024-01-24 aa33bb96ba9f14b16c6c7832e21bfbd88983ba6d
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderDetailMapper.java
@@ -71,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);
    /**
     * 查询未缴费项目
     */
@@ -118,12 +114,28 @@
            "  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} \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}")
            "\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" +
@@ -133,4 +145,13 @@
            "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);
}